]> git.sesse.net Git - vlc/commitdiff
livehttp: take block length in account when checking segment length
authorIlkka Ollakka <ileoo@videolan.org>
Thu, 28 Feb 2013 11:01:17 +0000 (13:01 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Thu, 28 Feb 2013 11:01:56 +0000 (13:01 +0200)
modules/access_output/livehttp.c

index d815dea38e9c845ed57f6a37afc6f493b0eb6e22..25db4a6c3f8c37178f72eb0d220c116a9e9d3b5f 100644 (file)
@@ -456,7 +456,10 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
             p_sys->block_buffer = NULL;
 
 
-            if( p_sys->i_handle > 0 && ( p_buffer->i_dts - p_sys->i_opendts ) >= p_sys->i_seglenm )
+            if( p_sys->i_handle > 0 &&
+                ( p_buffer->i_dts - p_sys->i_opendts +
+                  p_buffer->i_length * CLOCK_FREQ / INT64_C(1000000)
+                ) >= p_sys->i_seglenm )
                 closeCurrentSegment( p_access, p_sys, false );
 
             if ( p_sys->i_handle < 0 )