Skip to content
Snippets Groups Projects
Commit fa3a5dd4 authored by Andrew Stone's avatar Andrew Stone Committed by Anton Khirnov
Browse files

nutdec: update AVFormatContext.event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.


Signed-off-by: default avatarAnton Khirnov <anton@khirnov.net>
parent 0f789322
No related branches found
No related tags found
No related merge requests found
...@@ -461,9 +461,11 @@ static int decode_info_header(NUTContext *nut) ...@@ -461,9 +461,11 @@ static int decode_info_header(NUTContext *nut)
int64_t value, end; int64_t value, end;
char name[256], str_value[1024], type_str[256]; char name[256], str_value[1024], type_str[256];
const char *type; const char *type;
int *event_flags;
AVChapter *chapter = NULL; AVChapter *chapter = NULL;
AVStream *st = NULL; AVStream *st = NULL;
AVDictionary **metadata = NULL; AVDictionary **metadata = NULL;
int metadata_flag = 0;
end = get_packetheader(nut, bc, 1, INFO_STARTCODE); end = get_packetheader(nut, bc, 1, INFO_STARTCODE);
end += avio_tell(bc); end += avio_tell(bc);
...@@ -484,8 +486,13 @@ static int decode_info_header(NUTContext *nut) ...@@ -484,8 +486,13 @@ static int decode_info_header(NUTContext *nut)
} else if (stream_id_plus1) { } else if (stream_id_plus1) {
st = s->streams[stream_id_plus1 - 1]; st = s->streams[stream_id_plus1 - 1];
metadata = &st->metadata; metadata = &st->metadata;
} else event_flags = &st->event_flags;
metadata_flag = AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
} else {
metadata = &s->metadata; metadata = &s->metadata;
event_flags = &s->event_flags;
metadata_flag = AVFMT_EVENT_FLAG_METADATA_UPDATED;
}
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
get_str(bc, name, sizeof(name)); get_str(bc, name, sizeof(name));
...@@ -521,8 +528,10 @@ static int decode_info_header(NUTContext *nut) ...@@ -521,8 +528,10 @@ static int decode_info_header(NUTContext *nut)
continue; continue;
} }
if (metadata && av_strcasecmp(name, "Uses") && if (metadata && av_strcasecmp(name, "Uses") &&
av_strcasecmp(name, "Depends") && av_strcasecmp(name, "Replaces")) av_strcasecmp(name, "Depends") && av_strcasecmp(name, "Replaces")) {
*event_flags |= metadata_flag;
av_dict_set(metadata, name, str_value, 0); av_dict_set(metadata, name, str_value, 0);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment