[vlc-commits] access_output:livehttp: write output_last_length only once

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 19 10:32:26 2018 +0200| [7e8b08776343ecbac7d0a64b0900f3ab3e597e81] | committer: Steve Lhomme

access_output:livehttp: write output_last_length only once

easier to read

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

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

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 17f080e35a..221220818a 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -947,11 +947,13 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
     msg_Dbg( p_access, "Writing all full segments" );
 
     block_t *output = p_sys->full_segments;
-    vlc_tick_t output_last_length = 0;
+    vlc_tick_t output_last_length;
     if( output )
         output_last_length = output->i_length;
-    if( *p_sys->full_segments_end )
+    else if( *p_sys->full_segments_end )
         output_last_length = (*p_sys->full_segments_end)->i_length;
+    else
+        output_last_length = 0;
     p_sys->full_segments = NULL;
     p_sys->full_segments_end = &p_sys->full_segments;
 



More information about the vlc-commits mailing list