[vlc-commits] livehttp: fix the output length logic

Steve Lhomme git at videolan.org
Wed Sep 19 13:23:42 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 19 12:19:33 2018 +0200| [e069dca275f905401bf8288e8f71e7e61d89ea79] | committer: Steve Lhomme

livehttp: fix the output length logic

Following 7e8b08776343ecbac7d0a64b0900f3ab3e597e81 the value was originally
overwritten if *p_sys->full_segments_end is not NULL so use that first.

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

 modules/access_output/livehttp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 6f820efe0c..7c44f610ea 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -946,10 +946,10 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
 
     block_t *output = p_sys->full_segments;
     vlc_tick_t output_last_length;
-    if( output )
-        output_last_length = output->i_length;
-    else if( *p_sys->full_segments_end )
+    if( *p_sys->full_segments_end )
         output_last_length = (*p_sys->full_segments_end)->i_length;
+    else if( output )
+        output_last_length = output->i_length;
     else
         output_last_length = 0;
     p_sys->full_segments = NULL;



More information about the vlc-commits mailing list