summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-03-16 12:15:46 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-03-21 10:19:48 +0100
commit3d2f7c9ca06e9809272cbd4c3112eabc7c919280 (patch)
treece932275238599c3250967bb026e146d2af406a5
parent1925b8e9f78e8deb89d451e67b6edb8ca9d7b61f (diff)
downloadgst-plugins-bad-3d2f7c9ca06e9809272cbd4c3112eabc7c919280.tar.gz
gst-plugins-bad-3d2f7c9ca06e9809272cbd4c3112eabc7c919280.tar.bz2
gst-plugins-bad-3d2f7c9ca06e9809272cbd4c3112eabc7c919280.zip
mxfmux: Only add an essence container UL once to the partition and preface
-rw-r--r--gst/mxf/mxfmux.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/gst/mxf/mxfmux.c b/gst/mxf/mxfmux.c
index d6bcc30b..973415e0 100644
--- a/gst/mxf/mxfmux.c
+++ b/gst/mxf/mxfmux.c
@@ -446,11 +446,24 @@ gst_mxf_mux_create_metadata (GstMXFMux * mux)
tmp = g_array_new (FALSE, FALSE, sizeof (MXFUL));
for (l = mux->collect->data; l; l = l->next) {
GstMXFMuxPad *cpad = l->data;
+ guint i;
+ gboolean found = FALSE;
if (!cpad || !cpad->descriptor ||
mxf_ul_is_zero (&cpad->descriptor->essence_container))
return GST_FLOW_ERROR;
+ for (i = 0; i < tmp->len; i++) {
+ if (mxf_ul_is_equal (&cpad->descriptor->essence_container,
+ &g_array_index (tmp, MXFUL, i))) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (found)
+ continue;
+
g_array_append_val (tmp, cpad->descriptor->essence_container);
}
mux->preface->n_essence_containers = tmp->len;
@@ -893,13 +906,19 @@ gst_mxf_mux_create_header_partition_pack (GstMXFMux * mux)
for (l = mux->collect->data; l; l = l->next) {
GstMXFMuxPad *cpad = l->data;
guint j;
+ gboolean found = FALSE;
- for (j = 0; j < i; j++) {
+ for (j = 0; j <= i; j++) {
if (mxf_ul_is_equal (&cpad->descriptor->essence_container,
- &mux->partition.essence_containers[j]))
- continue;
+ &mux->partition.essence_containers[j])) {
+ found = TRUE;
+ break;
+ }
}
+ if (found)
+ continue;
+
memcpy (&mux->partition.essence_containers[i],
&cpad->descriptor->essence_container, 16);
i++;