Commit edeb3ffa authored by Ilkka Ollakka's avatar Ilkka Ollakka

livehttp: don't remove previous playlist on open if segment-number is 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
parent 85917d05
...@@ -264,6 +264,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -264,6 +264,7 @@ static int Open( vlc_object_t *p_this )
} }
path_sanitize( psz_tmp ); path_sanitize( psz_tmp );
p_sys->psz_indexPath = psz_tmp; p_sys->psz_indexPath = psz_tmp;
if( p_sys->i_initial_segment != 1 )
vlc_unlink( p_sys->psz_indexPath ); vlc_unlink( p_sys->psz_indexPath );
} }
...@@ -291,7 +292,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -291,7 +292,7 @@ static int Open( vlc_object_t *p_this )
} }
p_sys->i_handle = -1; 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_sys->psz_cursegPath = NULL;
p_access->pf_write = Write; p_access->pf_write = Write;
...@@ -564,7 +565,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t ...@@ -564,7 +565,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
if ( p_sys->i_numsegs == 0 || if ( p_sys->i_numsegs == 0 ||
p_sys->i_segment < ( p_sys->i_numsegs + p_sys->i_initial_segment ) ) 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 else
{ {
......
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