diff options
author | Anton Khirnov <wyskas@gmail.com> | 2010-10-24 11:28:04 +0400 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2010-10-24 11:28:04 +0400 |
commit | c55f891c2f767a4e9526da98bae7c1d48f0e980a (patch) | |
tree | 968489719636ae7d7fd0fc317ef01b68e7d42cf5 | |
parent | a5cea132023c09f3247046fd5493b707c3e98519 (diff) |
nutdec: when parsing info packet, set metadata var only once
Originally committed as revision 25558 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/nutdec.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index f8eda4f660..d5d7c2b219 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -406,6 +406,7 @@ static int decode_info_header(NUTContext *nut){ const char *type; AVChapter *chapter= NULL; AVStream *st= NULL; + AVMetadata **metadata = NULL; end= get_packetheader(nut, bc, 1, INFO_STARTCODE); end += url_ftell(bc); @@ -421,8 +422,12 @@ static int decode_info_header(NUTContext *nut){ chapter= ff_new_chapter(s, chapter_id, nut->time_base[chapter_start % nut->time_base_count], start, start + chapter_len, NULL); - } else if(stream_id_plus1) + metadata = &chapter->metadata; + } else if(stream_id_plus1) { st= s->streams[stream_id_plus1 - 1]; + metadata = &st->metadata; + } else + metadata = &s->metadata; for(i=0; i<count; i++){ get_str(bc, name, sizeof(name)); @@ -453,12 +458,10 @@ static int decode_info_header(NUTContext *nut){ } if(!strcmp(type, "UTF-8")){ - AVMetadata **metadata = NULL; - if(chapter_id==0 && !strcmp(name, "Disposition")) + if(chapter_id==0 && !strcmp(name, "Disposition")) { set_disposition_bits(s, str_value, stream_id_plus1 - 1); - else if(chapter) metadata= &chapter->metadata; - else if(stream_id_plus1) metadata= &st->metadata; - else metadata= &s->metadata; + continue; + } if(metadata && strcasecmp(name,"Uses") && strcasecmp(name,"Depends") && strcasecmp(name,"Replaces")) av_metadata_set2(metadata, name, str_value, 0); |