Commit c55f891c authored by Anton Khirnov's avatar Anton Khirnov

nutdec: when parsing info packet, set metadata var only once

Originally committed as revision 25558 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a5cea132
...@@ -406,6 +406,7 @@ static int decode_info_header(NUTContext *nut){ ...@@ -406,6 +406,7 @@ static int decode_info_header(NUTContext *nut){
const char *type; const char *type;
AVChapter *chapter= NULL; AVChapter *chapter= NULL;
AVStream *st= NULL; AVStream *st= NULL;
AVMetadata **metadata = NULL;
end= get_packetheader(nut, bc, 1, INFO_STARTCODE); end= get_packetheader(nut, bc, 1, INFO_STARTCODE);
end += url_ftell(bc); end += url_ftell(bc);
...@@ -421,8 +422,12 @@ static int decode_info_header(NUTContext *nut){ ...@@ -421,8 +422,12 @@ static int decode_info_header(NUTContext *nut){
chapter= ff_new_chapter(s, chapter_id, chapter= ff_new_chapter(s, chapter_id,
nut->time_base[chapter_start % nut->time_base_count], nut->time_base[chapter_start % nut->time_base_count],
start, start + chapter_len, NULL); 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]; st= s->streams[stream_id_plus1 - 1];
metadata = &st->metadata;
} else
metadata = &s->metadata;
for(i=0; i<count; i++){ for(i=0; i<count; i++){
get_str(bc, name, sizeof(name)); get_str(bc, name, sizeof(name));
...@@ -453,12 +458,10 @@ static int decode_info_header(NUTContext *nut){ ...@@ -453,12 +458,10 @@ static int decode_info_header(NUTContext *nut){
} }
if(!strcmp(type, "UTF-8")){ 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); set_disposition_bits(s, str_value, stream_id_plus1 - 1);
else if(chapter) metadata= &chapter->metadata; continue;
else if(stream_id_plus1) metadata= &st->metadata; }
else metadata= &s->metadata;
if(metadata && strcasecmp(name,"Uses") if(metadata && strcasecmp(name,"Uses")
&& strcasecmp(name,"Depends") && strcasecmp(name,"Replaces")) && strcasecmp(name,"Depends") && strcasecmp(name,"Replaces"))
av_metadata_set2(metadata, name, str_value, 0); av_metadata_set2(metadata, name, str_value, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment