[vlc-commits] mux:ts: mark code that is (un)likely to happen

Steve Lhomme git at videolan.org
Tue Sep 18 15:55:50 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun 13 09:53:10 2018 +0200| [44d60cfaca019ca822f8b08639eafadc898fb388] | committer: Steve Lhomme

mux:ts: mark code that is (un)likely to happen

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

 modules/mux/mpeg/ts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index ad25181343..152cea5248 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -1721,7 +1721,7 @@ static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
 
     BufferChainInit( &new_chain );
 
-    if ( i_pcr_length <= 0 )
+    if ( unlikely(i_pcr_length <= 0) )
     {
         i_pcr_length = i_packet_count;
     }
@@ -1774,7 +1774,7 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
     int i_packet_count = p_chain_ts->i_depth;
 
-    if ( i_pcr_length / 1000 > 0 )
+    if ( likely(i_pcr_length / 1000 > 0) )
     {
         int i_bitrate = ((uint64_t)i_packet_count * 188 * 8000)
                           / MS_FROM_VLC_TICK(i_pcr_length);



More information about the vlc-commits mailing list