avdemux: Set correct taglist scope for global vs. stream tags

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7366>
This commit is contained in:
Sebastian Dröge 2024-08-15 11:52:23 +03:00 committed by GStreamer Marge Bot
parent 76a037d29a
commit b86bf6d9c0

View file

@ -1044,6 +1044,7 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
if (stream->tags == NULL) if (stream->tags == NULL)
stream->tags = gst_tag_list_new_empty (); stream->tags = gst_tag_list_new_empty ();
gst_tag_list_set_scope (stream->tags, GST_TAG_SCOPE_STREAM);
gst_tag_list_add (stream->tags, GST_TAG_MERGE_REPLACE, gst_tag_list_add (stream->tags, GST_TAG_MERGE_REPLACE,
(ctx->codec_type == AVMEDIA_TYPE_VIDEO) ? (ctx->codec_type == AVMEDIA_TYPE_VIDEO) ?
GST_TAG_VIDEO_CODEC : GST_TAG_AUDIO_CODEC, codec, NULL); GST_TAG_VIDEO_CODEC : GST_TAG_AUDIO_CODEC, codec, NULL);
@ -1332,7 +1333,8 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
/* grab the global tags */ /* grab the global tags */
tags = gst_ffmpeg_metadata_to_tag_list (demux->context->metadata); tags = gst_ffmpeg_metadata_to_tag_list (demux->context->metadata);
if (tags) { if (tags) {
GST_INFO_OBJECT (demux, "global tags: %" GST_PTR_FORMAT, tags); gst_tag_list_set_scope (demux->tags, GST_TAG_SCOPE_GLOBAL);
GST_INFO_OBJECT (demux, "global tags: %" GST_PTR_FORMAT, demux->tags);
} }
/* now handle the stream tags */ /* now handle the stream tags */