replace remaining usage of deprecated av_metadata_set2() by av_dict_set()

This commit is contained in:
Aurelien Jacobs 2011-06-13 19:02:50 +02:00
parent 7ebaa967a2
commit e6ba3d4281
5 changed files with 13 additions and 13 deletions

View File

@ -78,7 +78,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
}
size += (size&1)-res;
str[res] = 0;
av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
av_dict_set(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
}else
size+= size&1;

View File

@ -1515,7 +1515,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
/* export stereo mode flag as metadata tag */
if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREO_MODE_COUNT)
av_metadata_set2(&st->metadata, "stereo_mode", matroska_video_stereo_mode[track->video.stereo_mode], 0);
av_dict_set(&st->metadata, "stereo_mode", matroska_video_stereo_mode[track->video.stereo_mode], 0);
/* if we have virtual track, mark the real tracks */
for (j=0; j < track->operation.combine_planes.nb_elem; j++) {
@ -1526,8 +1526,8 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
matroska_video_stereo_plane[planes[j].type], i);
for (k=0; k < matroska->tracks.nb_elem; k++)
if (planes[j].uid == tracks[k].uid) {
av_metadata_set2(&s->streams[k]->metadata,
"stereo_mode", buf, 0);
av_dict_set(&s->streams[k]->metadata,
"stereo_mode", buf, 0);
break;
}
}

View File

@ -1928,7 +1928,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc->height = height >> 16;
if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
av_metadata_set2(&st->metadata, "rotate", "180", 0);
av_dict_set(&st->metadata, "rotate", "180", 0);
}
// transform the display width/height according to the matrix

View File

@ -216,7 +216,7 @@ static inline int wav_parse_bext_string(AVFormatContext *s, const char *key, int
temp[length] = 0;
if (strlen(temp))
return av_metadata_set2(&s->metadata, key, temp, 0);
return av_dict_set(&s->metadata, key, temp, 0);
return 0;
}
@ -237,7 +237,7 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
time_reference = avio_rl64(s->pb);
snprintf(temp, sizeof(temp), "%"PRIu64, time_reference);
if ((ret = av_metadata_set2(&s->metadata, "time_reference", temp, 0)) < 0)
if ((ret = av_dict_set(&s->metadata, "time_reference", temp, 0)) < 0)
return ret;
/* check if version is >= 1, in which case an UMID may be present */
@ -259,7 +259,7 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
umid_parts[4], umid_parts[5], umid_parts[6], umid_parts[7]);
}
if ((ret = av_metadata_set2(&s->metadata, "umid", temp, 0)) < 0)
if ((ret = av_dict_set(&s->metadata, "umid", temp, 0)) < 0)
return ret;
}
@ -278,8 +278,8 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
return ret;
coding_history[size] = 0;
if ((ret = av_metadata_set2(&s->metadata, "coding_history", coding_history,
AV_METADATA_DONT_STRDUP_VAL)) < 0)
if ((ret = av_dict_set(&s->metadata, "coding_history", coding_history,
AV_METADATA_DONT_STRDUP_VAL)) < 0)
return ret;
}

View File

@ -431,7 +431,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
st = av_new_stream(s, 0);
if (!st)
goto done;
av_metadata_set2(&st->metadata, "title", description, 0);
av_dict_set(&st->metadata, "title", description, 0);
st->codec->codec_id = CODEC_ID_MJPEG;
st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
st->codec->extradata = av_mallocz(filesize);
@ -494,7 +494,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
return;
}
av_metadata_set2(&s->metadata, key, buf, 0);
av_dict_set(&s->metadata, key, buf, 0);
av_freep(&buf);
}
@ -818,7 +818,7 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
avio_read(pb, language, 3);
if (language[0]) {
language[3] = 0;
av_metadata_set2(&st->metadata, "language", language, 0);
av_dict_set(&st->metadata, "language", language, 0);
if (!strcmp(language, "nar") || !strcmp(language, "NAR"))
st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
}