summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/flac/gstflacdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c
index 1bfcf487..9c56fbf9 100644
--- a/ext/flac/gstflacdec.c
+++ b/ext/flac/gstflacdec.c
@@ -1119,6 +1119,13 @@ gst_flac_dec_handle_seek_event (GstFlacDec * flacdec, GstEvent * event)
/* operate on segment copy until we know the seek worked */
segment = flacdec->segment;
+ if (segment.duration > 0) {
+ if (start != -1)
+ start = CLAMP (start, 0, segment.duration - 1);
+ if (stop != -1)
+ stop = CLAMP (stop, 0, segment.duration - 1);
+ }
+
gst_segment_set_seek (&segment, rate, GST_FORMAT_DEFAULT,
seek_flags, start_type, start, stop_type, stop, &only_update);