diff --git a/ChangeLog b/ChangeLog index 311f396da4..127c6038f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-14 Jan Schmidt + + * gst/matroska/matroska-demux.c: + (gst_matroska_demux_handle_seek_event): + Fix open-ended seeks in matroskademux + Patch by: Mark Nauwelaerts + Fixes: #526557 + 2008-04-14 Jan Schmidt * tests/check/Makefile.am: diff --git a/common b/common index bdc5172b0b..f88ff852da 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit bdc5172b0ba183be6d92e58cb51782c23e9f2127 +Subproject commit f88ff852da7631ad2d0be835763da6d551a63883 diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index b67d78c45d..2b0ea0324a 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -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);