]> git.sesse.net Git - vlc/commitdiff
mpegvideo: add few likely/unlikely
authorIlkka Ollakka <ileoo@videolan.org>
Sat, 15 Mar 2014 15:15:41 +0000 (17:15 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 15 Jul 2014 13:07:19 +0000 (16:07 +0300)
modules/packetizer/mpegvideo.c

index 038366cbbe1a497835b68af574d33be9d8b689b1..2d21fa720fda0e0637ee13ba1415cd244df4fed3 100644 (file)
@@ -318,8 +318,8 @@ static int PacketizeValidate( void *p_private, block_t *p_au )
 
     /* If a discontinuity has been encountered, then wait till
      * the next Intra frame before continuing with packetizing */
-    if( p_sys->b_discontinuity &&
-        p_sys->b_sync_on_intra_frame )
+    if( unlikely( p_sys->b_discontinuity &&
+        p_sys->b_sync_on_intra_frame ) )
     {
         if( (p_au->i_flags & BLOCK_FLAG_TYPE_I) == 0 )
         {
@@ -333,8 +333,8 @@ static int PacketizeValidate( void *p_private, block_t *p_au )
 
     /* We've just started the stream, wait for the first PTS.
      * We discard here so we can still get the sequence header. */
-    if( p_sys->i_dts <= VLC_TS_INVALID && p_sys->i_pts <= VLC_TS_INVALID &&
-        p_sys->i_interpolated_dts <= VLC_TS_INVALID )
+    if( unlikely( p_sys->i_dts <= VLC_TS_INVALID && p_sys->i_pts <= VLC_TS_INVALID &&
+        p_sys->i_interpolated_dts <= VLC_TS_INVALID ))
     {
         msg_Dbg( p_dec, "need a starting pts/dts" );
         return VLC_EGENERIC;
@@ -342,7 +342,7 @@ static int PacketizeValidate( void *p_private, block_t *p_au )
 
     /* When starting the stream we can have the first frame with
      * an invalid DTS (i_interpolated_pts is initialized to VLC_TS_INVALID) */
-    if( p_au->i_dts <= VLC_TS_INVALID )
+    if( unlikely( p_au->i_dts <= VLC_TS_INVALID ) )
         p_au->i_dts = p_au->i_pts;
 
     return VLC_SUCCESS;