mirror of https://github.com/mpv-player/mpv
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:
parent
c470666c57
commit
c87beafb2c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue