[vlc-commits] libmpeg2: eliminate dead code and factor

Rémi Denis-Courmont git at videolan.org
Sun Sep 14 16:43:34 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Sep 14 17:42:26 2014 +0300| [a2383e92d2ec89b7d5fbfa615e37920368efb42b] | committer: Rémi Denis-Courmont

libmpeg2: eliminate dead code and factor

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

 modules/codec/libmpeg2.c |   36 ++++++++++--------------------------
 1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index 7d9e78b..0367537 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -386,7 +386,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                                        p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
 
 
-            bool b_skip = false;
+            picture_t *p_pic;
+
             if( !p_dec->b_pace_control && !p_sys->b_preroll &&
                 !(p_sys->b_slice_i
                    && ((p_current->flags
@@ -396,12 +397,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                                 & PIC_MASK_CODING_TYPE,
                               /*p_sys->p_vout->render_time*/ 0 /*FIXME*/,
                               p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ) )
-            {
-                b_skip = true;
-            }
-
-            picture_t *p_pic = NULL;
-            if( !b_skip )
+                p_pic = NULL;
+            else
             {
                 p_pic = DpbNewPicture( p_dec );
                 if( !p_pic )
@@ -418,28 +415,15 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 }
             }
 
-            if( b_skip || !p_pic )
-            {
-                mpeg2_skip( p_sys->p_mpeg2dec, 1 );
-                p_sys->b_skip = true;
+            mpeg2_skip( p_sys->p_mpeg2dec, p_pic == NULL );
+            p_sys->b_skip = p_pic == NULL;
+            if( p_pic != NULL )
+                decoder_SynchroDecode( p_sys->p_synchro );
+            else
                 decoder_SynchroTrash( p_sys->p_synchro );
 
-                PutPicture( p_dec, NULL );
+            PutPicture( p_dec, p_pic );
 
-                if( !b_skip )
-                {
-                    block_Release( p_block );
-                    return NULL;
-                }
-            }
-            else
-            {
-                mpeg2_skip( p_sys->p_mpeg2dec, 0 );
-                p_sys->b_skip = false;
-                decoder_SynchroDecode( p_sys->p_synchro );
-
-                PutPicture( p_dec, p_pic );
-            }
             if( p_info->user_data_len > 2 || p_sys->i_gop_user_data > 2 )
             {
                 p_sys->i_cc_pts = i_pts;



More information about the vlc-commits mailing list