[vlc-commits] decoder: cosmetic, balance mutex around a for-loop

Rémi Denis-Courmont git at videolan.org
Mon Apr 23 18:00:49 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 23 19:00:17 2012 +0300| [86e636577ca6ade955c1f024ff7cf61670e9c8ab] | committer: Rémi Denis-Courmont

decoder: cosmetic, balance mutex around a for-loop

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=86e636577ca6ade955c1f024ff7cf61670e9c8ab
---

 src/input/decoder.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index e630703..0b0cdf2 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1193,10 +1193,7 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
         DecoderWaitUnblock( p_dec, &b_reject );
 
         if( p_owner->b_buffering )
-        {
-            vlc_mutex_unlock( &p_owner->lock );
-            return;
-        }
+            break;
 
         /* */
         if( p_owner->buffer.p_audio )
@@ -1247,15 +1244,13 @@ static void DecoderPlayAudio( decoder_t *p_dec, aout_buffer_t *p_audio,
         }
 
         if( !b_has_more )
-            break;
+            return;
 
         vlc_mutex_lock( &p_owner->lock );
         if( !p_owner->buffer.p_audio )
-        {
-            vlc_mutex_unlock( &p_owner->lock );
             break;
-        }
     }
+    vlc_mutex_unlock( &p_owner->lock );
 }
 
 static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )



More information about the vlc-commits mailing list