mxfdemux: Allow filler and other KLV packets between index table segments
authorSebastian Dröge <sebastian@centricular.com>
Tue, 4 Jul 2017 17:01:37 +0000 (20:01 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 4 Jul 2017 17:18:38 +0000 (20:18 +0300)
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

index 9bfb6ec..5716f94 100644 (file)
@@ -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);