Commit 1d500945 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

decoder: simplify and avoid immediate unlock/lock pair

parent 53ab1eaf
...@@ -1138,21 +1138,18 @@ static void DecoderWaitDate( decoder_t *p_dec, ...@@ -1138,21 +1138,18 @@ static void DecoderWaitDate( decoder_t *p_dec,
if( *pb_reject || i_deadline < 0 ) if( *pb_reject || i_deadline < 0 )
return; return;
for( ;; ) vlc_mutex_lock( &p_owner->lock );
do
{ {
vlc_mutex_lock( &p_owner->lock );
if( p_owner->b_flushing || p_owner->b_exit ) if( p_owner->b_flushing || p_owner->b_exit )
{ {
*pb_reject = true; *pb_reject = true;
vlc_mutex_unlock( &p_owner->lock );
break; break;
} }
int i_ret = vlc_cond_timedwait( &p_owner->wait_request, &p_owner->lock,
i_deadline );
vlc_mutex_unlock( &p_owner->lock );
if( i_ret )
break;
} }
while( vlc_cond_timedwait( &p_owner->wait_request, &p_owner->lock,
i_deadline ) == 0 );
vlc_mutex_unlock( &p_owner->lock );
} }
static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio, static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
......
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