mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
replace remaining usage of deprecated av_metadata_set2() by av_dict_set()
This commit is contained in:
parent
7ebaa967a2
commit
e6ba3d4281
@ -78,7 +78,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
|
|||||||
}
|
}
|
||||||
size += (size&1)-res;
|
size += (size&1)-res;
|
||||||
str[res] = 0;
|
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
|
}else
|
||||||
size+= size&1;
|
size+= size&1;
|
||||||
|
|
||||||
|
@ -1515,7 +1515,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
|
|
||||||
/* export stereo mode flag as metadata tag */
|
/* export stereo mode flag as metadata tag */
|
||||||
if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREO_MODE_COUNT)
|
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 */
|
/* if we have virtual track, mark the real tracks */
|
||||||
for (j=0; j < track->operation.combine_planes.nb_elem; j++) {
|
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);
|
matroska_video_stereo_plane[planes[j].type], i);
|
||||||
for (k=0; k < matroska->tracks.nb_elem; k++)
|
for (k=0; k < matroska->tracks.nb_elem; k++)
|
||||||
if (planes[j].uid == tracks[k].uid) {
|
if (planes[j].uid == tracks[k].uid) {
|
||||||
av_metadata_set2(&s->streams[k]->metadata,
|
av_dict_set(&s->streams[k]->metadata,
|
||||||
"stereo_mode", buf, 0);
|
"stereo_mode", buf, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1928,7 +1928,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
sc->height = height >> 16;
|
sc->height = height >> 16;
|
||||||
|
|
||||||
if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
|
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
|
// transform the display width/height according to the matrix
|
||||||
|
@ -216,7 +216,7 @@ static inline int wav_parse_bext_string(AVFormatContext *s, const char *key, int
|
|||||||
temp[length] = 0;
|
temp[length] = 0;
|
||||||
|
|
||||||
if (strlen(temp))
|
if (strlen(temp))
|
||||||
return av_metadata_set2(&s->metadata, key, temp, 0);
|
return av_dict_set(&s->metadata, key, temp, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
|
|||||||
|
|
||||||
time_reference = avio_rl64(s->pb);
|
time_reference = avio_rl64(s->pb);
|
||||||
snprintf(temp, sizeof(temp), "%"PRIu64, time_reference);
|
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;
|
return ret;
|
||||||
|
|
||||||
/* check if version is >= 1, in which case an UMID may be present */
|
/* 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]);
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,8 +278,8 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
coding_history[size] = 0;
|
coding_history[size] = 0;
|
||||||
if ((ret = av_metadata_set2(&s->metadata, "coding_history", coding_history,
|
if ((ret = av_dict_set(&s->metadata, "coding_history", coding_history,
|
||||||
AV_METADATA_DONT_STRDUP_VAL)) < 0)
|
AV_METADATA_DONT_STRDUP_VAL)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
|
|||||||
st = av_new_stream(s, 0);
|
st = av_new_stream(s, 0);
|
||||||
if (!st)
|
if (!st)
|
||||||
goto done;
|
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_id = CODEC_ID_MJPEG;
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
|
st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT;
|
||||||
st->codec->extradata = av_mallocz(filesize);
|
st->codec->extradata = av_mallocz(filesize);
|
||||||
@ -494,7 +494,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
av_metadata_set2(&s->metadata, key, buf, 0);
|
av_dict_set(&s->metadata, key, buf, 0);
|
||||||
av_freep(&buf);
|
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);
|
avio_read(pb, language, 3);
|
||||||
if (language[0]) {
|
if (language[0]) {
|
||||||
language[3] = 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"))
|
if (!strcmp(language, "nar") || !strcmp(language, "NAR"))
|
||||||
st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
|
st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user