diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-12-29 15:51:59 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-12-29 15:51:59 +0200 |
commit | 57ce95b96a9d5ff75b5afa608bdda8366a999cf5 (patch) | |
tree | 416883d01181a719c50d460b49a2a7aa575bcfde /libmpcodecs/dec_audio.c | |
parent | d7d8babe61914f14df1fc1bab173574e1fabad1e (diff) |
audio: Remove fixed decode_audio() return size limit (MAX_OUTBURST)
A couple of months ago MPlayer's ALSA driver started rounding the
amount of input data it was willing to accept in one call down to an
integer multiple of the value it set in ao_data.outburst. In some
configurations it was possible for this value to exceed the 64 KiB
limit on the amount MPlayer was willing to write in a single call to
the AO. As a result ao_alsa accepted 0 bytes in each play() call and
audio playback failed. Fix this by removing the fixed 64 KiB limit on
the amount of audio sent to AO at once; the limit was mostly a remnant
of older code anyway.
Diffstat (limited to 'libmpcodecs/dec_audio.c')
-rw-r--r-- | libmpcodecs/dec_audio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index cd63b15b25..8d80e01ff4 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -74,10 +74,12 @@ static int init_audio_codec(sh_audio_t *sh_audio) sh_audio->a_in_buffer_len = 0; } - sh_audio->a_buffer_size = sh_audio->audio_out_minsize + MAX_OUTBURST; + const int base_size = 65536; + // At least 64 KiB plus rounding up to next decodable unit size + sh_audio->a_buffer_size = base_size + sh_audio->audio_out_minsize; mp_tmsg(MSGT_DECAUDIO, MSGL_V, "dec_audio: Allocating %d + %d = %d bytes for output buffer.\n", - sh_audio->audio_out_minsize, MAX_OUTBURST, sh_audio->a_buffer_size); + sh_audio->audio_out_minsize, base_size, sh_audio->a_buffer_size); sh_audio->a_buffer = av_mallocz(sh_audio->a_buffer_size); if (!sh_audio->a_buffer) { |