mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
mp3parse: fix accurate seeks to near 0
Integer underflow made accurate seeks to near zero fail and seek to completely the wrong place. Fix by clamping to zero, since we can't seek to negative times anyway.
This commit is contained in:
parent
ca2990b67c
commit
d61498d842
1 changed files with 3 additions and 1 deletions
|
@ -1794,12 +1794,14 @@ mp3parse_handle_seek (GstMPEGAudioParse * mp3parse, GstEvent * event)
|
|||
MPEGAudioSeekEntry *entry = NULL, *start_entry = NULL, *stop_entry = NULL;
|
||||
|
||||
GList *start_node, *stop_node;
|
||||
gint64 seek_ts = (cur > mp3parse->max_bitreservoir) ?
|
||||
(cur - mp3parse->max_bitreservoir) : 0;
|
||||
|
||||
for (start_node = mp3parse->seek_table; start_node;
|
||||
start_node = start_node->next) {
|
||||
entry = start_node->data;
|
||||
|
||||
if (cur - mp3parse->max_bitreservoir >= entry->timestamp) {
|
||||
if (seek_ts >= entry->timestamp) {
|
||||
start_entry = entry;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue