matroskademux: Non-update seeks should still make sure that reverse playback status is reset

Conflicts:
	gst/matroska/matroska-demux.c
This commit is contained in:
Sebastian Dröge 2012-07-20 15:28:21 +02:00
parent 9a83a0749e
commit b4621cbb3a

View file

@ -1540,26 +1540,29 @@ gst_matroska_demux_element_send_event (GstElement * element, GstEvent * event)
static gboolean
gst_matroska_demux_move_to_entry (GstMatroskaDemux * demux,
GstMatroskaIndex * entry, gboolean reset)
GstMatroskaIndex * entry, gboolean reset, gboolean update)
{
gint i;
GST_OBJECT_LOCK (demux);
/* seek (relative to matroska segment) */
/* position might be invalid; will error when streaming resumes ... */
demux->common.offset = entry->pos + demux->common.ebml_segment_start;
if (update) {
/* seek (relative to matroska segment) */
/* position might be invalid; will error when streaming resumes ... */
demux->common.offset = entry->pos + demux->common.ebml_segment_start;
GST_DEBUG_OBJECT (demux, "Seeked to offset %" G_GUINT64_FORMAT ", block %d, "
"time %" GST_TIME_FORMAT, entry->pos + demux->common.ebml_segment_start,
entry->block, GST_TIME_ARGS (entry->time));
GST_DEBUG_OBJECT (demux,
"Seeked to offset %" G_GUINT64_FORMAT ", block %d, " "time %"
GST_TIME_FORMAT, entry->pos + demux->common.ebml_segment_start,
entry->block, GST_TIME_ARGS (entry->time));
/* update the time */
gst_matroska_read_common_reset_streams (&demux->common, entry->time, TRUE);
demux->common.segment.position = entry->time;
demux->seek_block = entry->block;
demux->seek_first = TRUE;
demux->last_stop_end = GST_CLOCK_TIME_NONE;
/* update the time */
gst_matroska_read_common_reset_streams (&demux->common, entry->time, TRUE);
demux->common.segment.position = entry->time;
demux->seek_block = entry->block;
demux->seek_first = TRUE;
demux->last_stop_end = GST_CLOCK_TIME_NONE;
}
for (i = 0; i < demux->common.src->len; i++) {
GstMatroskaTrackContext *stream = g_ptr_array_index (demux->common.src, i);
@ -1571,6 +1574,7 @@ gst_matroska_demux_move_to_entry (GstMatroskaDemux * demux,
stream->to_offset = stream->from_offset;
}
stream->from_offset = -1;
stream->from_time = GST_CLOCK_TIME_NONE;
}
GST_OBJECT_UNLOCK (demux);
@ -2093,7 +2097,7 @@ exit:
GST_OBJECT_UNLOCK (demux);
/* update some (segment) state */
if (update && !gst_matroska_demux_move_to_entry (demux, entry, TRUE))
if (!gst_matroska_demux_move_to_entry (demux, entry, TRUE, update))
goto seek_error;
/* notify start of new segment */
@ -2362,7 +2366,7 @@ gst_matroska_demux_seek_to_previous_keyframe (GstMatroskaDemux * demux)
entry = &g_array_index (demux->seek_index, GstMatroskaIndex,
--demux->seek_entry);
if (!gst_matroska_demux_move_to_entry (demux, entry, FALSE))
if (!gst_matroska_demux_move_to_entry (demux, entry, FALSE, TRUE))
goto exit;
ret = GST_FLOW_OK;