Commit 88717885 authored by Laurent Aimar's avatar Laurent Aimar

Backport [20534] (Use of released buffer on race condition)

parent 692036c9
...@@ -296,7 +296,7 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout, ...@@ -296,7 +296,7 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first; p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
#if 0 /* This is bad because the audio output might just be trying to fill #if 0 /* This is bad because the audio output might just be trying to fill
* in it's internal buffers. And anyway, it's up to the audio output * in its internal buffers. And anyway, it's up to the audio output
* to deal with this kind of starvation. */ * to deal with this kind of starvation. */
/* Set date to 0, to allow the mixer to send a new buffer ASAP */ /* Set date to 0, to allow the mixer to send a new buffer ASAP */
...@@ -323,10 +323,12 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout, ...@@ -323,10 +323,12 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
* --Gibalou * --Gibalou
*/ */
{ {
const mtime_t i_delta = p_buffer->start_date - start_date;
vlc_mutex_unlock( &p_aout->output_fifo_lock ); vlc_mutex_unlock( &p_aout->output_fifo_lock );
if ( !p_aout->output.b_starving ) if ( !p_aout->output.b_starving )
msg_Dbg( p_aout, "audio output is starving ("I64Fd"), " msg_Dbg( p_aout, "audio output is starving ("I64Fd"), "
"playing silence", p_buffer->start_date - start_date ); "playing silence", i_delta );
p_aout->output.b_starving = 1; p_aout->output.b_starving = 1;
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment