summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-02 16:23:30 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-02 16:23:30 +0100
commit5277650a201528a2470e6e64a42258a3d77f4313 (patch)
tree0b64379a3fe5b875eda4aa20d32c27bc7042fa2e /gst
parent0c756199c02bbc7f4fe104dc79d0ebd4d4b1d805 (diff)
downloadgst-plugins-bad-5277650a201528a2470e6e64a42258a3d77f4313.tar.gz
gst-plugins-bad-5277650a201528a2470e6e64a42258a3d77f4313.tar.bz2
gst-plugins-bad-5277650a201528a2470e6e64a42258a3d77f4313.zip
Update tags properly, especially on component switch
Diffstat (limited to 'gst')
-rw-r--r--gst/mxf/mxfdemux.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c
index 54911f43..9e972dab 100644
--- a/gst/mxf/mxfdemux.c
+++ b/gst/mxf/mxfdemux.c
@@ -1063,11 +1063,12 @@ gst_mxf_demux_update_tracks (GstMXFDemux * demux)
pad->current_essence_track = etrack;
- if (pad->tags)
- gst_tag_list_free (pad->tags);
- pad->tags = NULL;
- if (etrack->tags)
- pad->tags = gst_tag_list_copy (etrack->tags);
+ if (etrack->tags) {
+ if (pad->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;
}