[vlc-commits] access_output:udp: compute the lateness only once and save a variable

Steve Lhomme git at videolan.org
Wed Sep 19 11:58:08 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 19 10:30:53 2018 +0200| [13ed3138339ec79498bf3f32ce62d149c841944c] | committer: Steve Lhomme

access_output:udp: compute the lateness only once and save a variable

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

 modules/access_output/udp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index f47bcaba5a..f25c59e095 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -362,7 +362,7 @@ static void* ThreadWrite( void *data )
     for (;;)
     {
         block_t *p_pk = block_FifoGet( p_sys->p_fifo );
-        vlc_tick_t    i_date, i_sent;
+        vlc_tick_t    i_date;
 
         i_date = p_sys->i_caching + p_pk->i_dts;
         if( i_date_last > 0 )
@@ -407,11 +407,11 @@ static void* ThreadWrite( void *data )
         i_date_last = i_date;
 
 #if 1
-        i_sent = vlc_tick_now();
-        if ( i_sent > i_date + VLC_TICK_FROM_MS(20) )
+        i_date = vlc_tick_now() - i_date;
+        if ( i_date > VLC_TICK_FROM_MS(20) )
         {
             msg_Dbg( p_access, "packet has been sent too late (%"PRId64 ")",
-                     i_sent - i_date );
+                     i_date );
         }
 #endif
 



More information about the vlc-commits mailing list