matroskademux: We need an index and index entry for reverse playback

Reverse playback does not work with index-less files yet.
This commit is contained in:
Sebastian Dröge 2012-07-20 14:25:43 +02:00
parent d90686f722
commit b02034dda1

View file

@ -1979,14 +1979,6 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
GST_DEBUG_OBJECT (demux, "New segment %" GST_SEGMENT_FORMAT, &seeksegment);
if (!update) {
/* only have to update some segment,
* but also still have to honour flush and so on */
GST_DEBUG_OBJECT (demux, "... no update");
/* bad goto, bad ... */
goto next;
}
/* check sanity before we start flushing and all that */
snap_next = after && !before;
if (seeksegment.rate < 0)
@ -2001,11 +1993,28 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
GST_DEBUG_OBJECT (demux, "No matching seek entry in index");
GST_OBJECT_UNLOCK (demux);
return FALSE;
} else if (rate < 0.0) {
/* FIXME: We should build an index during playback or when scanning
* that can be used here. The reverse playback code requires seek_index
* and seek_entry to be set!
*/
GST_DEBUG_OBJECT (demux,
"No matching seek entry in index, needed for reverse playback");
GST_OBJECT_UNLOCK (demux);
return FALSE;
}
}
GST_DEBUG_OBJECT (demux, "Seek position looks sane");
GST_OBJECT_UNLOCK (demux);
if (!update) {
/* only have to update some segment,
* but also still have to honour flush and so on */
GST_DEBUG_OBJECT (demux, "... no update");
/* bad goto, bad ... */
goto next;
}
if (demux->streaming) {
GST_OBJECT_LOCK (demux);
/* now update the real segment info */