mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 02:32:23 +00:00
Update tags properly, especially on component switch
This commit is contained in:
parent
0c756199c0
commit
5277650a20
1 changed files with 18 additions and 5 deletions
|
@ -1063,11 +1063,12 @@ gst_mxf_demux_update_tracks (GstMXFDemux * demux)
|
|||
|
||||
pad->current_essence_track = etrack;
|
||||
|
||||
if (etrack->tags) {
|
||||
if (pad->tags)
|
||||
gst_tag_list_free (pad->tags);
|
||||
pad->tags = NULL;
|
||||
if (etrack->tags)
|
||||
gst_tag_list_insert (pad->tags, etrack->tags, GST_TAG_MERGE_REPLACE);
|
||||
else
|
||||
pad->tags = gst_tag_list_copy (etrack->tags);
|
||||
}
|
||||
|
||||
if (GST_PAD_CAPS (pad)
|
||||
&& !gst_caps_is_equal (GST_PAD_CAPS (pad), etrack->caps)) {
|
||||
|
@ -1313,6 +1314,7 @@ gst_mxf_demux_pad_set_component (GstMXFDemux * demux, GstMXFDemuxPad * pad,
|
|||
guint k;
|
||||
MXFMetadataSourcePackage *source_package = NULL;
|
||||
MXFMetadataTimelineTrack *source_track = NULL;
|
||||
gboolean update = (pad->current_component_index != i);
|
||||
|
||||
pad->current_component_index = i;
|
||||
|
||||
|
@ -1410,6 +1412,17 @@ gst_mxf_demux_pad_set_component (GstMXFDemux * demux, GstMXFDemuxPad * pad,
|
|||
gst_pad_set_caps (GST_PAD_CAST (pad), pad->current_essence_track->caps);
|
||||
}
|
||||
|
||||
if (update) {
|
||||
if (pad->tags) {
|
||||
if (pad->current_essence_track->tags)
|
||||
gst_tag_list_insert (pad->tags, pad->current_essence_track->tags,
|
||||
GST_TAG_MERGE_REPLACE);
|
||||
} else {
|
||||
if (pad->current_essence_track->tags)
|
||||
pad->tags = gst_tag_list_copy (pad->current_essence_track->tags);
|
||||
}
|
||||
}
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue