summaryrefslogtreecommitdiffstats
path: root/gst/mxf
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-09 17:55:05 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-09 17:55:05 +0100
commit1229f0a149bb4d9dc989832650e6b019ffbcc5a0 (patch)
tree8c8594e91de81d66b912e0b0cf6e4e24617e791a /gst/mxf
parentdf0dd0b378ba3b6bc754a0f16970eeab0b144840 (diff)
downloadgst-plugins-bad-1229f0a149bb4d9dc989832650e6b019ffbcc5a0.tar.gz
gst-plugins-bad-1229f0a149bb4d9dc989832650e6b019ffbcc5a0.tar.bz2
gst-plugins-bad-1229f0a149bb4d9dc989832650e6b019ffbcc5a0.zip
mxfdemux: When trying to find an essence track position try to find position+1 too
By searching for the following position we will add the complete generic container (i.e. all tracks) at the same position to the index which should make finding positions for more than one track a bit faster.
Diffstat (limited to 'gst/mxf')
-rw-r--r--gst/mxf/mxfdemux.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c
index 9704b9fe..957d853e 100644
--- a/gst/mxf/mxfdemux.c
+++ b/gst/mxf/mxfdemux.c
@@ -2443,20 +2443,20 @@ from_index:
}
}
- if (G_UNLIKELY (ret != GST_FLOW_OK)) {
+ if (G_UNLIKELY (ret != GST_FLOW_OK) && etrack->position <= *position) {
demux->offset = old_offset;
demux->current_partition = old_partition;
break;
+ } else if (G_UNLIKELY (ret == GST_FLOW_OK)) {
+ ret = gst_mxf_demux_handle_klv_packet (demux, &key, buffer, TRUE);
+ gst_buffer_unref (buffer);
}
- ret = gst_mxf_demux_handle_klv_packet (demux, &key, buffer, TRUE);
-
- gst_buffer_unref (buffer);
-
/* If we found the position read it from the index again */
- if (ret == GST_FLOW_OK && etrack->position == *position + 1 &&
- etrack->offsets && etrack->offsets->len > *position &&
- g_array_index (etrack->offsets, GstMXFDemuxIndex,
+ if (((ret == GST_FLOW_OK && etrack->position == *position + 2) ||
+ (ret == GST_FLOW_UNEXPECTED && etrack->position == *position + 1))
+ && etrack->offsets && etrack->offsets->len > *position
+ && g_array_index (etrack->offsets, GstMXFDemuxIndex,
*position).offset != 0) {
GST_DEBUG_OBJECT (demux, "Found at offset %" G_GUINT64_FORMAT,
demux->offset);