summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/mxf/mxfmux.c')
-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++;