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

decoder: remove tautology, add asserts to waiting code

parent 16e30392
......@@ -516,17 +516,15 @@ void input_DecoderStartWait( decoder_t *p_dec )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
vlc_mutex_lock( &p_owner->lock );
assert( !p_owner->b_waiting );
vlc_mutex_lock( &p_owner->lock );
DecoderFlush( p_dec );
p_owner->b_first = true;
p_owner->b_has_data = false;
p_owner->b_waiting = true;
vlc_cond_signal( &p_owner->wait_request );
vlc_mutex_unlock( &p_owner->lock );
}
......@@ -534,12 +532,11 @@ void input_DecoderStopWait( decoder_t *p_dec )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
vlc_mutex_lock( &p_owner->lock );
assert( p_owner->b_waiting );
vlc_mutex_lock( &p_owner->lock );
p_owner->b_waiting = false;
vlc_cond_signal( &p_owner->wait_request );
vlc_mutex_unlock( &p_owner->lock );
}
......@@ -547,14 +544,14 @@ void input_DecoderWait( decoder_t *p_dec )
{
decoder_owner_sys_t *p_owner = p_dec->p_owner;
vlc_mutex_lock( &p_owner->lock );
assert( p_owner->b_waiting );
while( p_owner->b_waiting && !p_owner->b_has_data )
vlc_mutex_lock( &p_owner->lock );
while( !p_owner->b_has_data )
{
block_FifoWake( p_owner->p_fifo );
vlc_cond_wait( &p_owner->wait_acknowledge, &p_owner->lock );
}
vlc_mutex_unlock( &p_owner->lock );
}
......
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