mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
matroska-mux: If a stream has a TITLE tag, use it for the name.
If a title tag is pushed to a pad, store it as the Track name. This means that players will use it as the human readable description of the track, instead of something generic like 'Video' or 'Subtitle' Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1798>
This commit is contained in:
parent
7efdc9c7f5
commit
cebf769725
1 changed files with 11 additions and 1 deletions
|
@ -865,12 +865,22 @@ gst_matroska_mux_handle_sink_event (GstCollectPads * pads,
|
||||||
g_free (lang);
|
g_free (lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: what about stream-specific tags? */
|
|
||||||
if (gst_tag_list_get_scope (list) == GST_TAG_SCOPE_GLOBAL) {
|
if (gst_tag_list_get_scope (list) == GST_TAG_SCOPE_GLOBAL) {
|
||||||
gst_tag_setter_merge_tags (GST_TAG_SETTER (mux), list,
|
gst_tag_setter_merge_tags (GST_TAG_SETTER (mux), list,
|
||||||
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (mux)));
|
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (mux)));
|
||||||
} else {
|
} else {
|
||||||
|
gchar *title = NULL;
|
||||||
|
|
||||||
|
/* Stream specific tags */
|
||||||
gst_tag_list_insert (collect_pad->tags, list, GST_TAG_MERGE_REPLACE);
|
gst_tag_list_insert (collect_pad->tags, list, GST_TAG_MERGE_REPLACE);
|
||||||
|
|
||||||
|
/* If the tags contain a title, update the context name to write it there */
|
||||||
|
if (gst_tag_list_get_string (list, GST_TAG_TITLE, &title)) {
|
||||||
|
GST_INFO_OBJECT (pad, "Setting track name to '%s'", title);
|
||||||
|
g_free (context->name);
|
||||||
|
context->name = g_strdup (title);
|
||||||
|
}
|
||||||
|
g_free (title);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
|
|
Loading…
Reference in a new issue