diff --git a/subprojects/gstreamer/libs/gst/base/gstbaseparse.c b/subprojects/gstreamer/libs/gst/base/gstbaseparse.c index 6b9636dbbb..472f88fcf2 100644 --- a/subprojects/gstreamer/libs/gst/base/gstbaseparse.c +++ b/subprojects/gstreamer/libs/gst/base/gstbaseparse.c @@ -952,16 +952,11 @@ gst_base_parse_queue_tag_event_update (GstBaseParse * parse) GST_DEBUG_OBJECT (parse, "merged : %" GST_PTR_FORMAT, merged_tags); if (merged_tags == NULL) - return; - - if (gst_tag_list_is_empty (merged_tags)) { - gst_tag_list_unref (merged_tags); - return; - } + merged_tags = gst_tag_list_new_empty (); if (parse->priv->framecount >= MIN_FRAMES_TO_POST_BITRATE) { - /* only add bitrate tags to non-empty taglists for now, and only if neither - * upstream tags nor the subclass sets the bitrate tag in question already */ + /* only add bitrate tags if neither upstream tags nor the subclass sets the + * bitrate tag in question already */ if (parse->priv->min_bitrate != G_MAXUINT && parse->priv->post_min_bitrate) { GST_LOG_OBJECT (parse, "adding min bitrate %u", parse->priv->min_bitrate); gst_tag_list_add (merged_tags, GST_TAG_MERGE_KEEP, @@ -980,6 +975,11 @@ gst_base_parse_queue_tag_event_update (GstBaseParse * parse) } } + if (gst_tag_list_is_empty (merged_tags)) { + gst_tag_list_unref (merged_tags); + return; + } + parse->priv->pending_events = g_list_prepend (parse->priv->pending_events, gst_event_new_tag (merged_tags));