audio: fill small AO buffers more often in audio-only case
commitc2067cabafa272dc96d51a3969c024d09fb7a78d
authorUoti Urpala <uau@mplayer2.org>
Fri, 22 Apr 2011 04:07:54 +0000 (22 07:07 +0300)
committerUoti Urpala <uau@mplayer2.org>
Fri, 22 Apr 2011 06:34:02 +0000 (22 09:34 +0300)
tree441efe87ee1d9f0ef7fb0c08eb17cd511add2476
parentd33877acb6db9beb050083ee53a4cfaf7c6ffbab
audio: fill small AO buffers more often in audio-only case

Commit cbeed30ae8 ("core: wake up a bit less often for audio-only
files") increased the sleep time between audio buffer fills. This
turned out to cause problems on some machines where available audio
buffer sizes are extremely limited (example cases included 85 ms for
stereo and less for multichannel audio). Change the code to check
the amount of buffered audio and shorten sleep times accordingly if
needed.

Such short buffers violate some assumptions made by video timing code,
so they may still cause visible problems in some cases. At least on
some machines using ALSA the problem seems to be caused by bad
configuration defaults (small buffer memory limit which can be
increased).
mplayer.c