Commit cbba895c authored by Ilkka Ollakka's avatar Ilkka Ollakka

livehttp: simplify checks

(cherry picked from commit ce474970e88b2af6e0237bfe08106da19427bce0)
Signed-off-by: default avatarIlkka Ollakka <ileoo@videolan.org>
parent 52b11457
......@@ -904,8 +904,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 );
......@@ -973,8 +973,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 )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment