From f7527242b12a063b8a17bd5e0df6fc6e382a5ea2 Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 11 Dec 2001 09:23:57 +0000 Subject: 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 --- libao2/ao_oss.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libao2') 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 -- cgit v1.2.3