mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 21:48:55 +00:00
ext/flac/gstflacdec.c: Don't try to seek beyond the end of the file (would occasionally display error dialogs in tote...
Original commit message from CVS: * ext/flac/gstflacdec.c: (gst_flac_dec_handle_seek_event): Don't try to seek beyond the end of the file (would occasionally display error dialogs in totem when seeking to the end) (#335869). Will still throw an error though if the file is truncated and the total_samples value in the stream header is wrong.
This commit is contained in:
parent
661ddc65c3
commit
d4e7ce1e52
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2006-04-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* ext/flac/gstflacdec.c: (gst_flac_dec_handle_seek_event):
|
||||||
|
Don't try to seek beyond the end of the file (would
|
||||||
|
occasionally display error dialogs in totem when seeking
|
||||||
|
to the end) (#335869). Will still throw an error though
|
||||||
|
if the file is truncated and the total_samples value in
|
||||||
|
the stream header is wrong.
|
||||||
|
|
||||||
2006-04-07 Tim-Philipp Müller <tim at centricular dot net>
|
2006-04-07 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* ext/flac/gstflacdec.c: (gst_flac_calculate_crc8),
|
* ext/flac/gstflacdec.c: (gst_flac_calculate_crc8),
|
||||||
|
|
|
@ -1119,6 +1119,13 @@ gst_flac_dec_handle_seek_event (GstFlacDec * flacdec, GstEvent * event)
|
||||||
/* operate on segment copy until we know the seek worked */
|
/* operate on segment copy until we know the seek worked */
|
||||||
segment = flacdec->segment;
|
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,
|
gst_segment_set_seek (&segment, rate, GST_FORMAT_DEFAULT,
|
||||||
seek_flags, start_type, start, stop_type, stop, &only_update);
|
seek_flags, start_type, start, stop_type, stop, &only_update);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue