summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorsteve <steve@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-11 09:23:57 +0000
committersteve <steve@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-11 09:23:57 +0000
commitf7527242b12a063b8a17bd5e0df6fc6e382a5ea2 (patch)
treefd675b532f259733385b6066c34ae73881430848 /libao2
parent6ca596f928540f1cb23ac7495f9f84386e164780 (diff)
downloadmpv-f7527242b12a063b8a17bd5e0df6fc6e382a5ea2.tar.bz2
mpv-f7527242b12a063b8a17bd5e0df6fc6e382a5ea2.tar.xz
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
Diffstat (limited to 'libao2')
-rw-r--r--libao2/ao_oss.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c
index a0675cbdcc..d7c51d4427 100644
--- a/libao2/ao_oss.c
+++ b/libao2/ao_oss.c
@@ -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