diff options
author | Andrew Stone <andrew@clovar.com> | 2014-08-12 17:03:55 -0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-08-13 16:25:19 +0000 |
commit | db68ef898a3802e51b6f41fd600d0d46d058e3f8 (patch) | |
tree | c4b4d1fa52b024c5c86a318f4b5be772f23923d3 /libavformat/flacdec.c | |
parent | cc3e88a2b9e7ecf62e4ea1c41ce1623cea67ee96 (diff) | |
download | ffmpeg-db68ef898a3802e51b6f41fd600d0d46d058e3f8.tar.gz |
ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.
Originally, AVFormatContext and a metadata dict were provided to ff_vorbis_comment(),
but this presented issues if an AVStream was being updated or the metadata on
AVFormatContext wasn't actually being updated. To remedy this, ff_vorbis_stream_comment()
explicitly updates a stream's metadata and sets any necessary flags.
ff_vorbis_comment() does not modify any flags, and any calls to it that update
AVFormatContext's metadata (just a single call) must also update
AVFormatContext.event_flags after detecting any metadata changes to the provided
dictionary, as signaled by a positive return value.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/flacdec.c')
-rw-r--r-- | libavformat/flacdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 05286c71cd..e044fd0b5a 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -141,8 +141,11 @@ static int flac_read_header(AVFormatContext *s) if (metadata_type == FLAC_METADATA_TYPE_VORBIS_COMMENT) { AVDictionaryEntry *chmask; - if (ff_vorbis_comment(s, &s->metadata, buffer, metadata_size, 1)) { + ret = ff_vorbis_comment(s, &s->metadata, buffer, metadata_size, 1); + if (ret < 0) { av_log(s, AV_LOG_WARNING, "error parsing VorbisComment metadata\n"); + } else if (ret > 0) { + s->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED; } /* parse the channels mask if present */ |