[MPlayer-cvslog] r25941 - trunk/libao2/ao_openal.c

reimar subversion at mplayerhq.hu
Thu Jan 31 00:48:48 CET 2008


Author: reimar
Date: Thu Jan 31 00:48:48 2008
New Revision: 25941

Log:
Fix get_space calculation to always leave some space, esp. for the currently playing buffer.

Modified:
   trunk/libao2/ao_openal.c

Modified: trunk/libao2/ao_openal.c
==============================================================================
--- trunk/libao2/ao_openal.c	(original)
+++ trunk/libao2/ao_openal.c	Thu Jan 31 00:48:48 2008
@@ -201,7 +201,9 @@ static int get_space(void) {
   ALint queued;
   unqueue_buffers();
   alGetSourcei(sources[0], AL_BUFFERS_QUEUED, &queued);
-  return (NUM_BUF - queued) * CHUNK_SIZE * ao_data.channels;
+  queued = NUM_BUF - queued - 3;
+  if (queued < 0) return 0;
+  return queued * CHUNK_SIZE * ao_data.channels;
 }
 
 /**



More information about the MPlayer-cvslog mailing list