mxfdemux: Don't include any KLV packets between header metadata and index table segments in calculations

Minor fixup of last commit.
This commit is contained in:
Sebastian Dröge 2017-07-05 00:48:36 +03:00
parent 72b7794798
commit 37e0439e84

View file

@ -2016,23 +2016,34 @@ read_partition_header (GstMXFDemux * demux)
return; return;
} }
while (demux->offset < while (mxf_is_fill (&key)) {
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; demux->offset += read;
gst_buffer_unref (buf); gst_buffer_unref (buf);
if (gst_mxf_demux_pull_klv_packet (demux, demux->offset, &key, &buf, &read) if (gst_mxf_demux_pull_klv_packet (demux, demux->offset, &key, &buf, &read)
!= GST_FLOW_OK) != GST_FLOW_OK)
return; return;
} }
if (demux->current_partition->partition.index_byte_count
&& mxf_is_index_table_segment (&key)) {
guint64 index_end_offset =
demux->offset + demux->current_partition->partition.index_byte_count;
while (demux->offset < index_end_offset) {
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);
if (gst_mxf_demux_pull_klv_packet (demux, demux->offset, &key, &buf,
&read)
!= GST_FLOW_OK)
return;
}
}
while (mxf_is_fill (&key)) { while (mxf_is_fill (&key)) {
demux->offset += read; demux->offset += read;
gst_buffer_unref (buf); gst_buffer_unref (buf);