[vlc-commits] decoder: reduce lock scope, remove stray signal
Rémi Denis-Courmont
git at videolan.org
Wed Apr 1 19:40:14 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 1 20:35:13 2015 +0300| [e17d14e32b271a08fbebb2a25e535704fb03cd24] | committer: Rémi Denis-Courmont
decoder: reduce lock scope, remove stray signal
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e17d14e32b271a08fbebb2a25e535704fb03cd24
---
src/input/decoder.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 76c4038..fc69435 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2127,20 +2127,18 @@ void input_DecoderWait( decoder_t *p_dec )
assert( p_owner->b_waiting );
vlc_mutex_lock( &p_owner->lock );
- vlc_fifo_Lock( p_owner->p_fifo );
while( !p_owner->b_has_data )
{
+ vlc_fifo_Lock( p_owner->p_fifo );
if( p_owner->b_idle && vlc_fifo_IsEmpty( p_owner->p_fifo ) )
{
msg_Warn( p_dec, "can't wait without data to decode" );
+ vlc_fifo_Unlock( p_owner->p_fifo );
break;
}
- vlc_fifo_Signal( p_owner->p_fifo );
vlc_fifo_Unlock( p_owner->p_fifo );
vlc_cond_wait( &p_owner->wait_acknowledge, &p_owner->lock );
- vlc_fifo_Lock( p_owner->p_fifo );
}
- vlc_fifo_Unlock( p_owner->p_fifo );
vlc_mutex_unlock( &p_owner->lock );
}
More information about the vlc-commits
mailing list