Commit 2f4528c0 authored by Ilkka Ollakka's avatar Ilkka Ollakka

livehttp: place correct segment entries on playlist

This fixes the logical flaw that places segment info on playlist that
was next to remove and didn't place the newest segment info into
playlist.
parent a799659d
...@@ -495,11 +495,15 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t ...@@ -495,11 +495,15 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
{ {
uint32_t i_firstseg; uint32_t i_firstseg;
unsigned i_index_offset = 0;
if ( p_sys->i_numsegs == 0 || p_sys->i_segment < p_sys->i_numsegs ) if ( p_sys->i_numsegs == 0 || p_sys->i_segment < p_sys->i_numsegs )
i_firstseg = 1; i_firstseg = 1;
else else
{
i_firstseg = ( p_sys->i_segment - p_sys->i_numsegs ) + 1; i_firstseg = ( p_sys->i_segment - p_sys->i_numsegs ) + 1;
i_index_offset = vlc_array_count( p_sys->segments_t ) - p_sys->i_numsegs;
}
// First update index // First update index
if ( p_sys->psz_indexPath ) if ( p_sys->psz_indexPath )
...@@ -533,8 +537,8 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t ...@@ -533,8 +537,8 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
for ( uint32_t i = i_firstseg; i <= p_sys->i_segment; i++ ) for ( uint32_t i = i_firstseg; i <= p_sys->i_segment; i++ )
{ {
//scale to 0..numsegs-1 //scale to i_index_offset..numsegs + i_index_offset
uint32_t index = i-i_firstseg; uint32_t index = i - i_firstseg + i_index_offset;
output_segment_t *segment = (output_segment_t *)vlc_array_item_at_index( p_sys->segments_t, index ); output_segment_t *segment = (output_segment_t *)vlc_array_item_at_index( p_sys->segments_t, index );
if( p_sys->key_uri && if( p_sys->key_uri &&
......
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