diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-07-20 10:48:34 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-07-20 10:48:34 +0200 |
commit | 75016c4795d8078a88fdcc2e8f596825d85f8888 (patch) | |
tree | 43d251aba9cc5d1afbf876a6d49e6d0db19dce95 /gst/matroska | |
parent | 6ea79eae2c8070c5e2e350b8416f09377691f14e (diff) |
matroskademux: Only take the stream_start_time into account for SET seeks
For other seeks the stream_start_time is already added to the
segment values.
Diffstat (limited to 'gst/matroska')
-rw-r--r-- | gst/matroska/matroska-demux.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 292d692e1..724b599d7 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -1933,8 +1933,7 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux, * we might be playing a file that's still being recorded * so, invalidate our current duration, which is only a moving target, * and should not be used to clamp anything */ - if (!demux->streaming && !demux->common.index && - demux->invalid_duration) { + if (!demux->streaming && !demux->common.index && demux->invalid_duration) { gst_segment_set_duration (&seeksegment, GST_FORMAT_TIME, GST_CLOCK_TIME_NONE); } @@ -1943,13 +1942,20 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux, GST_DEBUG_OBJECT (demux, "configuring seek"); gst_segment_set_seek (&seeksegment, rate, format, flags, cur_type, cur, stop_type, stop, &update); - /* compensate for clip start time */ + /* compensate for clip start time, but only for SET seeks, + * otherwise it is already part of the segments */ if (GST_CLOCK_TIME_IS_VALID (demux->stream_start_time)) { - seeksegment.last_stop += demux->stream_start_time; - seeksegment.start += demux->stream_start_time; - if (GST_CLOCK_TIME_IS_VALID (seeksegment.stop)) + if (cur_type == GST_SEEK_TYPE_SET) { + if (rate > 0.0) + seeksegment.last_stop += demux->stream_start_time; + seeksegment.start += demux->stream_start_time; + } + if (stop_type == GST_SEEK_TYPE_SET + && GST_CLOCK_TIME_IS_VALID (seeksegment.stop)) { + if (rate < 0.0) + seeksegment.last_stop += demux->stream_start_time; seeksegment.stop += demux->stream_start_time; - /* note that time should stay at indicated position */ + } } } |