[vlc-commits] livehttp: simplify checks

Ilkka Ollakka git at videolan.org
Tue Jul 15 15:09:30 CEST 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Jul  6 11:22:08 2014 +0300| [ce474970e88b2af6e0237bfe08106da19427bce0] | committer: Ilkka Ollakka

livehttp: simplify checks

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

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

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index faf8f49..a6f4c9b 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -903,8 +903,8 @@ static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
     block_t *output = p_sys->block_buffer;
 
     if( p_sys->i_handle > 0 &&
-        ( ( p_buffer->i_dts - p_sys->i_opendts +
-          ( p_buffer->i_length * CLOCK_FREQ / INT64_C(1000000) )
+       (( p_buffer->i_dts - p_sys->i_opendts +
+           p_buffer->i_length
         ) >= p_sys->i_seglenm ) )
      {
         closeCurrentSegment( p_access, p_sys, false );
@@ -972,8 +972,8 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
         }
 
         p_sys->f_seglen =
-            (float)(output->i_length / INT64_C(1000000) ) +
-            (float)(output->i_dts - p_sys->i_opendts) / CLOCK_FREQ;
+            (float)(output->i_length + p_sys->i_dts_offset +
+                    output->i_dts - p_sys->i_opendts) / CLOCK_FREQ;
 
         if ( (size_t)val >= output->i_buffer )
         {



More information about the vlc-commits mailing list