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>
This commit is contained in:
Andrew Stone
2014-08-12 17:03:55 -04:00
committed by Anton Khirnov
parent cc3e88a2b9
commit db68ef898a
9 changed files with 32 additions and 11 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ static int opus_header(AVFormatContext *avf, int idx)
if (priv->need_comments) {
if (os->psize < 8 || memcmp(packet, "OpusTags", 8))
return AVERROR_INVALIDDATA;
ff_vorbis_comment(avf, &st->metadata, packet + 8, os->psize - 8, 1);
ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8);
priv->need_comments--;
return 1;
}