Commit 42b5065c authored by Sebastian Dröge's avatar Sebastian Dröge

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.

Conflicts:
	gst/matroska/matroska-demux.c
parent cc6d5335
......@@ -1946,13 +1946,20 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
GST_DEBUG_OBJECT (demux, "configuring seek");
gst_segment_do_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.position += 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.position += 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.position += demux->stream_start_time;
seeksegment.stop += demux->stream_start_time;
/* note that time should stay at indicated position */
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment