[MPlayer-cvslog] r34241 - trunk/libao2/ao_coreaudio.c

reimar subversion at mplayerhq.hu
Sun Oct 23 14:03:14 CEST 2011


Author: reimar
Date: Sun Oct 23 14:03:13 2011
New Revision: 34241

Log:
Fix possible crash since RenderCallbackSPDIF might call read_buffer with NULL data.

The purpose of that is to drain data from the buffer when the output is muted.

Modified:
   trunk/libao2/ao_coreaudio.c

Modified: trunk/libao2/ao_coreaudio.c
==============================================================================
--- trunk/libao2/ao_coreaudio.c	Sun Oct 23 14:00:24 2011	(r34240)
+++ trunk/libao2/ao_coreaudio.c	Sun Oct 23 14:03:13 2011	(r34241)
@@ -133,7 +133,10 @@ static int write_buffer(unsigned char* d
 static int read_buffer(unsigned char* data,int len){
   int buffered = av_fifo_size(ao->buffer);
   if (len > buffered) len = buffered;
+  if (data)
   av_fifo_generic_read(ao->buffer, data, len, NULL);
+  else
+    av_fifo_drain(ao->buffer, len);
   return len;
 }
 


More information about the MPlayer-cvslog mailing list