mirror of https://github.com/mpv-player/mpv
ao_coreaudio: fix crash when using mute with S/PDIF output
RenderCallbackSPDIF might call read_buffer with NULL data. The purpose is to drain data from the buffer when the output is muted. Add a check to call av_fifo_drain() in this case. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34241 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34242 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
075edf91f1
commit
9fae75b81c
|
@ -133,7 +133,10 @@ static int write_buffer(unsigned char* data, int len){
|
|||
static int read_buffer(unsigned char* data,int len){
|
||||
int buffered = av_fifo_size(ao->buffer);
|
||||
if (len > buffered) len = buffered;
|
||||
av_fifo_generic_read(ao->buffer, data, len, NULL);
|
||||
if (data)
|
||||
av_fifo_generic_read(ao->buffer, data, len, NULL);
|
||||
else
|
||||
av_fifo_drain(ao->buffer, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue