changeset 3455:921a78c7b4aa

limit get_space return <= MAX_OUTBURST, whilst always an exact number of fragments
author steve
date Tue, 11 Dec 2001 09:23:57 +0000
parents 78057c7120f6
children ebab4801241f
files libao2/ao_oss.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_oss.c	Tue Dec 11 01:07:40 2001 +0000
+++ b/libao2/ao_oss.c	Tue Dec 11 09:23:57 2001 +0000
@@ -241,7 +241,10 @@
 #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