diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-05-22 12:46:29 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-06-08 07:43:45 +0200 |
commit | d2d67e424fa10d883e13709095c80bd3b502ce03 (patch) | |
tree | 3ff3180c011e728fbda17dd40e200c0f4946eb07 /libavformat/utils.c | |
parent | d9f80ea2a7325f9c84307568843512811a99baff (diff) | |
download | ffmpeg-streaming-d2d67e424fa10d883e13709095c80bd3b502ce03.zip ffmpeg-streaming-d2d67e424fa10d883e13709095c80bd3b502ce03.tar.gz |
Remove all uses of now deprecated metadata functions.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index bdc20f6..8ab59e1 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -26,6 +26,7 @@ #include "internal.h" #include "libavcodec/internal.h" #include "libavutil/opt.h" +#include "libavutil/dict.h" #include "metadata.h" #include "id3v2.h" #include "libavutil/avstring.h" @@ -2560,7 +2561,7 @@ void avformat_free_context(AVFormatContext *s) av_parser_close(st->parser); av_free_packet(&st->cur_pkt); } - av_metadata_free(&st->metadata); + av_dict_free(&st->metadata); av_free(st->index_entries); av_free(st->codec->extradata); av_free(st->codec->subtitle_header); @@ -2570,18 +2571,18 @@ void avformat_free_context(AVFormatContext *s) av_free(st); } for(i=s->nb_programs-1; i>=0; i--) { - av_metadata_free(&s->programs[i]->metadata); + av_dict_free(&s->programs[i]->metadata); av_freep(&s->programs[i]->stream_index); av_freep(&s->programs[i]); } av_freep(&s->programs); av_freep(&s->priv_data); while(s->nb_chapters--) { - av_metadata_free(&s->chapters[s->nb_chapters]->metadata); + av_dict_free(&s->chapters[s->nb_chapters]->metadata); av_free(s->chapters[s->nb_chapters]); } av_freep(&s->chapters); - av_metadata_free(&s->metadata); + av_dict_free(&s->metadata); av_freep(&s->streams); av_free(s); } @@ -2685,7 +2686,7 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6 return NULL; dynarray_add(&s->chapters, &s->nb_chapters, chapter); } - av_metadata_set2(&chapter->metadata, "title", title, 0); + av_dict_set(&chapter->metadata, "title", title, 0); chapter->id = id; chapter->time_base= time_base; chapter->start = start; @@ -2824,7 +2825,7 @@ int av_write_header(AVFormatContext *s) /* set muxer identification string */ if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) { - av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0); + av_dict_set(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0); } if(s->oformat->write_header){ @@ -3138,13 +3139,13 @@ static void print_fps(double d, const char *postfix){ else av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d/1000, postfix); } -static void dump_metadata(void *ctx, AVMetadata *m, const char *indent) +static void dump_metadata(void *ctx, AVDictionary *m, const char *indent) { - if(m && !(m->count == 1 && av_metadata_get(m, "language", NULL, 0))){ - AVMetadataTag *tag=NULL; + if(m && !(m->count == 1 && av_dict_get(m, "language", NULL, 0))){ + AVDictionaryEntry *tag=NULL; av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent); - while((tag=av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) { + while((tag=av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { if(strcmp("language", tag->key)) av_log(ctx, AV_LOG_INFO, "%s %-16s: %s\n", indent, tag->key, tag->value); } @@ -3158,7 +3159,7 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); AVStream *st = ic->streams[i]; int g = av_gcd(st->time_base.num, st->time_base.den); - AVMetadataTag *lang = av_metadata_get(st->metadata, "language", NULL, 0); + AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); avcodec_string(buf, sizeof(buf), st->codec, is_output); av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i); /* the pid is an important information, so we display it */ @@ -3282,7 +3283,7 @@ void av_dump_format(AVFormatContext *ic, if(ic->nb_programs) { int j, k, total = 0; for(j=0; j<ic->nb_programs; j++) { - AVMetadataTag *name = av_metadata_get(ic->programs[j]->metadata, + AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata, "name", NULL, 0); av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id, name ? name->value : ""); |