Skip to content

Commit

Permalink
livehttp: don't remove previous playlist on open if segment-number is…
Browse files Browse the repository at this point in the history
… given

If we provide initial segment-number, most likely we want to continue
where we have left of, so leave old playlist-file there and just
overwrite it when we updated it.

default initial-segment-number is 1 so don't test against 0
  • Loading branch information
ilkka-ollakka committed Dec 5, 2014
1 parent 85917d0 commit edeb3ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/access_output/livehttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ static int Open( vlc_object_t *p_this )
}
path_sanitize( psz_tmp );
p_sys->psz_indexPath = psz_tmp;
vlc_unlink( p_sys->psz_indexPath );
if( p_sys->i_initial_segment != 1 )
vlc_unlink( p_sys->psz_indexPath );
}

p_sys->psz_indexUrl = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "index-url" );
Expand All @@ -291,7 +292,7 @@ static int Open( vlc_object_t *p_this )
}

p_sys->i_handle = -1;
p_sys->i_segment = p_sys->i_initial_segment > 0 ? p_sys->i_initial_segment -1 : 0;
p_sys->i_segment = p_sys->i_initial_segment-1;
p_sys->psz_cursegPath = NULL;

p_access->pf_write = Write;
Expand Down Expand Up @@ -564,7 +565,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
if ( p_sys->i_numsegs == 0 ||
p_sys->i_segment < ( p_sys->i_numsegs + p_sys->i_initial_segment ) )
{
i_firstseg = p_sys->i_initial_segment == 0 ? 1 : p_sys->i_initial_segment;
i_firstseg = p_sys->i_initial_segment;
}
else
{
Expand Down

0 comments on commit edeb3ff

Please sign in to comment.