- if(chapter_id==0 && !strcmp(type, "UTF-8")){
- if (!strcmp(name, "Author"))
- av_strlcpy(s->author , str_value, sizeof(s->author));
- else if(!strcmp(name, "Title"))
- av_strlcpy(s->title , str_value, sizeof(s->title));
- else if(!strcmp(name, "Copyright"))
- av_strlcpy(s->copyright, str_value, sizeof(s->copyright));
- else if(!strcmp(name, "Description"))
- av_strlcpy(s->comment , str_value, sizeof(s->comment));
+ if (stream_id_plus1 > s->nb_streams) {
+ av_log(s, AV_LOG_ERROR, "invalid stream id for info packet\n");
+ continue;
+ }
+
+ if(!strcmp(type, "UTF-8")){
+ AVMetadata **metadata = NULL;
+ 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;
+ if(metadata && strcasecmp(name,"Uses")
+ && strcasecmp(name,"Depends") && strcasecmp(name,"Replaces"))
+ av_metadata_set(metadata, name, str_value);