Commit 8f2a1c0b authored by Mark Nauwelaerts's avatar Mark Nauwelaerts Committed by Jan Schmidt

gst/matroska/matroska-demux.c: Fix open-ended seeks in matroskademux

Original commit message from CVS:
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_handle_seek_event):
Fix open-ended seeks in matroskademux
Patch by: Mark Nauwelaerts <manauw skynet be>
Fixes: #526557
parent 2bdd92b2
2008-04-14 Jan Schmidt <Jan.Schmidt@sun.com>
* gst/matroska/matroska-demux.c:
(gst_matroska_demux_handle_seek_event):
Fix open-ended seeks in matroskademux
Patch by: Mark Nauwelaerts <manauw skynet be>
Fixes: #526557
2008-04-14 Jan Schmidt <jan.schmidt@sun.com>
* tests/check/Makefile.am:
......
common @ f88ff852
Subproject commit bdc5172b0ba183be6d92e58cb51782c23e9f2127
Subproject commit f88ff852da7631ad2d0be835763da6d551a63883
......@@ -1397,24 +1397,27 @@ gst_matroska_demux_handle_seek_event (GstMatroskaDemux * demux,
GST_OBJECT_LOCK (demux);
/* if nothing configured, play complete file */
if (cur == GST_CLOCK_TIME_NONE)
if (!GST_CLOCK_TIME_IS_VALID (cur))
cur = 0;
if (stop == GST_CLOCK_TIME_NONE)
if (!GST_CLOCK_TIME_IS_VALID (stop))
stop = demux->segment.duration;
/* prevent some calculations and comparisons involving INVALID */
segment_start = demux->segment.start;
segment_stop = demux->segment.stop;
if (!GST_CLOCK_TIME_IS_VALID (segment_start))
segment_start = 0;
if (!GST_CLOCK_TIME_IS_VALID (segment_stop))
segment_stop = demux->segment.duration;
if (cur_type == GST_SEEK_TYPE_SET)
segment_start = cur;
else if (cur_type == GST_SEEK_TYPE_CUR)
segment_start = demux->segment.start + cur;
else
segment_start = demux->segment.start;
segment_start += cur;
if (stop_type == GST_SEEK_TYPE_SET)
segment_stop = stop;
else if (stop_type == GST_SEEK_TYPE_CUR)
segment_stop = demux->segment.stop + stop;
else
segment_stop = demux->segment.stop;
segment_stop += stop;
segment_start = CLAMP (segment_start, 0, demux->segment.duration);
segment_stop = CLAMP (segment_stop, 0, demux->segment.duration);
......
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