[vlc-devel] commit: Small code factorization ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Oct 22 21:47:24 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Oct 22 22:47:04 2008 +0300| [3110258d24150892b6fbff19d5868a004e0c26af] | committer: Rémi Denis-Courmont 

Small code factorization

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

 src/input/decoder.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index e2bfc49..7787e7d 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -722,26 +722,23 @@ static void *DecoderThread( vlc_object_t *p_this )
     int canc = vlc_savecancel();
 
     /* The decoder's main loop */
-    while( vlc_object_alive( p_dec ) && !p_dec->b_error )
-    {
-        block_t *p_block = block_FifoGet( p_owner->p_fifo );
-
-        DecoderSignalBuffering( p_dec, p_block == NULL );
-
-        if( p_block && DecoderProcess( p_dec, p_block ) != VLC_SUCCESS )
-            break;
-    }
-
     while( vlc_object_alive( p_dec ) )
     {
         block_t *p_block = block_FifoGet( p_owner->p_fifo );
 
         DecoderSignalBuffering( p_dec, p_block == NULL );
 
-        /* Trash all received PES packets */
         if( p_block )
-            block_Release( p_block );
+        {
+            if( p_dec->b_error )
+            {   /* Trash all received PES packets */
+                block_Release( p_block );
+            }
+            else if( DecoderProcess( p_dec, p_block ) != VLC_SUCCESS )
+                break;
+        }
     }
+
     DecoderSignalBuffering( p_dec, true );
 
     /* We do it here because of the dll loader that wants close() in the




More information about the vlc-devel mailing list