[MPlayer-cvslog] r24610 - trunk/libao2/ao_alsa.c

uau subversion at mplayerhq.hu
Mon Sep 24 23:49:58 CEST 2007


Author: uau
Date: Mon Sep 24 23:49:58 2007
New Revision: 24610

Log:
ao_alsa: Fix get_space() return values larger than buffersize

After a buffer underrun the ALSA get_space() function sometimes returned
values larger than the ao had set in ao_data.buffersize. Fix this by
replacing the old check against MAX_OUTBURST by one against
ao_data.buffersize. There should be no need for the MAX_OUTBURST check;
the current MPlayer side should no longer have any constant limit on the
amount of data an ao can buffer or request at once.

The get_space() values larger than ao_data.buffersize triggered errors
in audio decoding causing the current attempt to fill audio buffers to
be aborted. I'm not sure how often that caused behavior noticeably worse
then an underrun already is.


Modified:
   trunk/libao2/ao_alsa.c

Modified: trunk/libao2/ao_alsa.c
==============================================================================
--- trunk/libao2/ao_alsa.c	(original)
+++ trunk/libao2/ao_alsa.c	Mon Sep 24 23:49:58 2007
@@ -861,8 +861,8 @@ static int get_space(void)
     }
     
     ret = snd_pcm_status_get_avail(status) * bytes_per_sample;
-    if (ret > MAX_OUTBURST)
-	    ret = MAX_OUTBURST;
+    if (ret > ao_data.buffersize)  // Buffer underrun?
+	ret = ao_data.buffersize;
     return(ret);
 }
 



More information about the MPlayer-cvslog mailing list