1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 20:27:23 +00:00

limit get_space return <= MAX_OUTBURST, whilst always an exact number of fragments

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3456 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
steve 2001-12-11 09:23:57 +00:00
parent 6ca596f928
commit f7527242b1

View File

@ -241,7 +241,10 @@ static int get_space(){
#ifdef SNDCTL_DSP_GETOSPACE
if(ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &zz)!=-1){
// calculate exact buffer space:
return zz.fragments*zz.fragsize;
playsize = zz.fragments*zz.fragsize;
if (playsize > MAX_OUTBURST)
playsize = (MAX_OUTBURST / zz.fragsize) * zz.fragsize;
return playsize;
}
#endif