mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
baseparse: Add bitrate tags to empty taglists too
It's unclear why empty taglists should be handled in a special way. If the subclass or upstream did not provide any tags at all then we can still provide bitrate tags at least. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8157>
This commit is contained in:
parent
228dd25a0a
commit
d08fb9c241
1 changed files with 8 additions and 8 deletions
|
@ -952,16 +952,11 @@ gst_base_parse_queue_tag_event_update (GstBaseParse * parse)
|
||||||
GST_DEBUG_OBJECT (parse, "merged : %" GST_PTR_FORMAT, merged_tags);
|
GST_DEBUG_OBJECT (parse, "merged : %" GST_PTR_FORMAT, merged_tags);
|
||||||
|
|
||||||
if (merged_tags == NULL)
|
if (merged_tags == NULL)
|
||||||
return;
|
merged_tags = gst_tag_list_new_empty ();
|
||||||
|
|
||||||
if (gst_tag_list_is_empty (merged_tags)) {
|
|
||||||
gst_tag_list_unref (merged_tags);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parse->priv->framecount >= MIN_FRAMES_TO_POST_BITRATE) {
|
if (parse->priv->framecount >= MIN_FRAMES_TO_POST_BITRATE) {
|
||||||
/* only add bitrate tags to non-empty taglists for now, and only if neither
|
/* only add bitrate tags if neither upstream tags nor the subclass sets the
|
||||||
* upstream tags nor the subclass sets the bitrate tag in question already */
|
* bitrate tag in question already */
|
||||||
if (parse->priv->min_bitrate != G_MAXUINT && parse->priv->post_min_bitrate) {
|
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_LOG_OBJECT (parse, "adding min bitrate %u", parse->priv->min_bitrate);
|
||||||
gst_tag_list_add (merged_tags, GST_TAG_MERGE_KEEP,
|
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 =
|
parse->priv->pending_events =
|
||||||
g_list_prepend (parse->priv->pending_events,
|
g_list_prepend (parse->priv->pending_events,
|
||||||
gst_event_new_tag (merged_tags));
|
gst_event_new_tag (merged_tags));
|
||||||
|
|
Loading…
Reference in a new issue