mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
mxfmux: Only add an essence container UL once to the partition and preface
This commit is contained in:
parent
1925b8e9f7
commit
3d2f7c9ca0
1 changed files with 22 additions and 3 deletions
|
@ -446,11 +446,24 @@ gst_mxf_mux_create_metadata (GstMXFMux * mux)
|
||||||
tmp = g_array_new (FALSE, FALSE, sizeof (MXFUL));
|
tmp = g_array_new (FALSE, FALSE, sizeof (MXFUL));
|
||||||
for (l = mux->collect->data; l; l = l->next) {
|
for (l = mux->collect->data; l; l = l->next) {
|
||||||
GstMXFMuxPad *cpad = l->data;
|
GstMXFMuxPad *cpad = l->data;
|
||||||
|
guint i;
|
||||||
|
gboolean found = FALSE;
|
||||||
|
|
||||||
if (!cpad || !cpad->descriptor ||
|
if (!cpad || !cpad->descriptor ||
|
||||||
mxf_ul_is_zero (&cpad->descriptor->essence_container))
|
mxf_ul_is_zero (&cpad->descriptor->essence_container))
|
||||||
return GST_FLOW_ERROR;
|
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);
|
g_array_append_val (tmp, cpad->descriptor->essence_container);
|
||||||
}
|
}
|
||||||
mux->preface->n_essence_containers = tmp->len;
|
mux->preface->n_essence_containers = tmp->len;
|
||||||
|
@ -893,12 +906,18 @@ gst_mxf_mux_create_header_partition_pack (GstMXFMux * mux)
|
||||||
for (l = mux->collect->data; l; l = l->next) {
|
for (l = mux->collect->data; l; l = l->next) {
|
||||||
GstMXFMuxPad *cpad = l->data;
|
GstMXFMuxPad *cpad = l->data;
|
||||||
guint j;
|
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,
|
if (mxf_ul_is_equal (&cpad->descriptor->essence_container,
|
||||||
&mux->partition.essence_containers[j]))
|
&mux->partition.essence_containers[j])) {
|
||||||
continue;
|
found = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
continue;
|
||||||
|
|
||||||
memcpy (&mux->partition.essence_containers[i],
|
memcpy (&mux->partition.essence_containers[i],
|
||||||
&cpad->descriptor->essence_container, 16);
|
&cpad->descriptor->essence_container, 16);
|
||||||
|
|
Loading…
Reference in a new issue