summaryrefslogtreecommitdiff
path: root/gst/mxf
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-01-29 16:38:23 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-01-29 17:02:32 +0100
commitcd17ea1070df09aaca68be2abc445beef4053951 (patch)
tree4b866cc836c8353fd3d7ec83a0be6f59bbaf6b9a /gst/mxf
parentb276de78275b61481384b1edc532a7ebe69079f5 (diff)
downloadgstreamer-plugins-bad-cd17ea1070df09aaca68be2abc445beef4053951.tar.gz
mxfmux: Rewrite body partition pack on EOS and mark it as complete/closed
Diffstat (limited to 'gst/mxf')
-rw-r--r--gst/mxf/mxfmux.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gst/mxf/mxfmux.c b/gst/mxf/mxfmux.c
index 97b87d881..d9ceb96e8 100644
--- a/gst/mxf/mxfmux.c
+++ b/gst/mxf/mxfmux.c
@@ -1466,6 +1466,7 @@ gst_mxf_mux_handle_eos (GstMXFMux * mux)
GList *index_entries = NULL, *l;
guint index_byte_count = 0;
guint i;
+ GstBuffer *buf;
for (i = 0; i < mux->index_table->len; i++) {
MXFIndexTableSegment *segment =
@@ -1538,6 +1539,28 @@ gst_mxf_mux_handle_eos (GstMXFMux * mux)
GST_ERROR_OBJECT (mux, "Rewriting header partition failed");
return ret;
}
+
+ g_assert (mux->offset == body_partition);
+
+ mux->partition.type = MXF_PARTITION_PACK_BODY;
+ mux->partition.closed = TRUE;
+ mux->partition.complete = TRUE;
+ mux->partition.this_partition = mux->offset;
+ mux->partition.prev_partition = 0;
+ mux->partition.footer_partition = footer_partition;
+ mux->partition.header_byte_count = 0;
+ mux->partition.index_byte_count = 0;
+ mux->partition.index_sid = 0;
+ mux->partition.body_offset = 0;
+ mux->partition.body_sid =
+ mux->preface->content_storage->essence_container_data[0]->body_sid;
+
+ buf = mxf_partition_pack_to_buffer (&mux->partition);
+ ret = gst_mxf_mux_push (mux, buf);
+ if (ret != GST_FLOW_OK) {
+ GST_ERROR_OBJECT (mux, "Rewriting body partition failed");
+ return ret;
+ }
} else {
GST_WARNING_OBJECT (mux, "Can't rewrite header partition");
}