Fix get_space calculation to always leave some space, esp. for the currently playing buffer.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25941 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2008-01-30 23:48:48 +00:00
parent c470666c57
commit c87beafb2c
1 changed files with 3 additions and 1 deletions

View File

@ -201,7 +201,9 @@ static int get_space(void) {
ALint queued; ALint queued;
unqueue_buffers(); unqueue_buffers();
alGetSourcei(sources[0], AL_BUFFERS_QUEUED, &queued); alGetSourcei(sources[0], AL_BUFFERS_QUEUED, &queued);
return (NUM_BUF - queued) * CHUNK_SIZE * ao_data.channels; queued = NUM_BUF - queued - 3;
if (queued < 0) return 0;
return queued * CHUNK_SIZE * ao_data.channels;
} }
/** /**