summaryrefslogtreecommitdiff
path: root/gst/matroska
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-07-20 15:28:21 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-07-20 15:28:21 +0200
commit8137d201a80c24fc5daca88005a119a089152f29 (patch)
treed53089806e345ede71284369e99b1d8a9153d45c /gst/matroska
parentaa23380d192b7c32290ee2ab977b558af8dc35d0 (diff)
matroskademux: Non-update seeks should still make sure that reverse playback status is reset
Diffstat (limited to 'gst/matroska')
-rw-r--r--gst/matroska/matroska-demux.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index c1ee82ce7..de2c59731 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -1547,26 +1547,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.last_stop = 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.last_stop = 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);
@@ -1578,6 +1581,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);
@@ -2101,7 +2105,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 */
@@ -2348,7 +2352,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;