diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-07-05 00:48:36 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-07-05 00:49:25 +0300 |
commit | 37e0439e84104b4f7ca9e972fd87af35fbd72af0 (patch) | |
tree | 34d26c6682424961cfaa13b05bd350beb33a7c39 /gst/mxf | |
parent | 72b7794798c38f25319fd7dff425a75f8ae1afc5 (diff) | |
download | gstreamer-plugins-bad-37e0439e84104b4f7ca9e972fd87af35fbd72af0.tar.gz |
mxfdemux: Don't include any KLV packets between header metadata and index table segments in calculations
Minor fixup of last commit.
Diffstat (limited to 'gst/mxf')
-rw-r--r-- | gst/mxf/mxfdemux.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 5716f949f..d796e807b 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -2016,23 +2016,34 @@ read_partition_header (GstMXFDemux * demux) return; } - 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); - } + while (mxf_is_fill (&key)) { demux->offset += read; - gst_buffer_unref (buf); if (gst_mxf_demux_pull_klv_packet (demux, demux->offset, &key, &buf, &read) != GST_FLOW_OK) 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)) { demux->offset += read; gst_buffer_unref (buf); |