gst-av icon indicating copy to clipboard operation
gst-av copied to clipboard

Fix uint32_t overflow that was causing glitched audio

Open javispedro opened this issue 10 years ago • 2 comments

The following patch fixes a uint32_t overflow which happens with small sample rates.

Given the default buffer size (192000 bytes), and 8000Hz 1 channels s16 spec, the buffer duration is 12 seconds which is larger than UINT32_MAX. Because of an implicit cast in calculate_duration, it would return garbage values, which in turn means gst-av would push broken timestamps. This would confuse the audio sink, causing rather large skips.

This problem can be easily reproduced with some highly-compressed audio podcasts. See https://together.jolla.com/question/23341/garbled-playback-of-some-mp3s-with-builtin-player/

Thanks to @keithzg for documenting the problem and collecting testcases.

javispedro avatar Sep 26 '14 23:09 javispedro

LGTM. +1

thp avatar Oct 01 '14 15:10 thp

The SFOS-specific repo is now available at https://github.com/sailfishos/gst-av and this patch has been merged there.

thp avatar May 31 '15 05:05 thp