From 72b7794798c38f25319fd7dff425a75f8ae1afc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 4 Jul 2017 20:01:37 +0300 Subject: [PATCH] mxfdemux: Allow filler and other KLV packets between index table segments While only filler packets should be allowed, for good measure also skip any other KLV packets in the range where there could be index table segments. This fixes parsing of partitions with multiple index table segments, which are separated by a filler packet, or other packets. --- gst/mxf/mxfdemux.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 9bfb6ec598..5716f949fe 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -2016,8 +2016,15 @@ read_partition_header (GstMXFDemux * demux) return; } - while (mxf_is_index_table_segment (&key)) { - gst_mxf_demux_handle_index_table_segment (demux, &key, buf, demux->offset); + while (demux->offset < + demux->run_in + + demux->current_partition->partition.this_partition + + demux->current_partition->partition.header_byte_count + + demux->current_partition->partition.index_byte_count) { + if (mxf_is_index_table_segment (&key)) { + gst_mxf_demux_handle_index_table_segment (demux, &key, buf, + demux->offset); + } demux->offset += read; gst_buffer_unref (buf);