matroskademux: improve decision to fall back to scanning when seeking
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Wed, 21 Dec 2011 14:06:57 +0000 (15:06 +0100)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Wed, 21 Dec 2011 14:45:36 +0000 (15:45 +0100)
... which is basically iff not streaming and no entry found in index

gst/matroska/matroska-demux.c

index 81f83f0..2ce2d76 100644 (file)
@@ -1962,7 +1962,7 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
               seeksegment.last_stop, &demux->seek_index, &demux->seek_entry)) ==
       NULL) {
     /* pull mode without index can scan later on */
-    if (demux->common.index || demux->streaming) {
+    if (demux->streaming) {
       GST_DEBUG_OBJECT (demux, "No matching seek entry in index");
       GST_OBJECT_UNLOCK (demux);
       return FALSE;
@@ -1999,7 +1999,7 @@ next:
   GST_PAD_STREAM_LOCK (demux->common.sinkpad);
 
   /* pull mode without index can do some scanning */
-  if (!demux->streaming && !demux->common.index) {
+  if (!demux->streaming && !entry) {
     /* need to stop flushing upstream as we need it next */
     if (flush)
       gst_pad_push_event (demux->common.sinkpad, gst_event_new_flush_stop ());