<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 15, 2013 at 1:28 AM, Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 14 Nov 2013 16:27:42 -0800, Ray Tiley <<a href="mailto:raytiley@gmail.com">raytiley@gmail.com</a>> wrote:<br>
> The initial-segment-number option allows for passing in the number for<br>
the<br>
> first<br>
> segment. This is useful if you want to append to an existing live<br>
> stream.<br>
<br>
</div>This is somewhat questionable... how will the caller know what the last<br>
segment was? Presumably, the previous incantation of VLC was responsible<br>
for keeping track of that, rather than the caller script.<br></blockquote><div><br></div><div>In my use case VLC is not generating the manifest files, so I know exactly what the next sequence # should be. The option is similar to the -initial-sequence-number -I in Apple's mediastreamingsegmenter tool.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
><br>
> Fix initial segment patch<br>
> ---<br>
> modules/access_output/livehttp.c | 16 +++++++++++++---<br>
> 1 file changed, 13 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/modules/access_output/livehttp.c<br>
> b/modules/access_output/livehttp.c<br>
> index 82539bc..b04300e 100644<br>
> --- a/modules/access_output/livehttp.c<br>
> +++ b/modules/access_output/livehttp.c<br>
> @@ -104,6 +104,9 @@ static void Close( vlc_object_t * );<br>
> #define RANDOMIV_TEXT N_("Use randomized IV for encryption")<br>
> #define RANDOMIV_LONGTEXT N_("Generate IV instead using segment-number<br>
as<br>
> IV")<br>
><br>
> +#define INTITIAL_SEG_TEXT N_("Number of first segment")<br>
> +#define INITIAL_SEG_LONGTEXT N_("The number of the segmented<br>
generated")<br>
> +<br>
> vlc_module_begin ()<br>
> set_description( N_("HTTP Live streaming output") )<br>
> set_shortname( N_("LiveHTTP" ))<br>
> @@ -113,6 +116,7 @@ vlc_module_begin ()<br>
> set_subcategory( SUBCAT_SOUT_ACO )<br>
> add_integer( SOUT_CFG_PREFIX "seglen", 10, SEGLEN_TEXT,<br>
> SEGLEN_LONGTEXT, false )<br>
> add_integer( SOUT_CFG_PREFIX "numsegs", 0, NUMSEGS_TEXT,<br>
> NUMSEGS_LONGTEXT, false )<br>
> + add_integer( SOUT_CFG_PREFIX "initial-segment-number", 1,<br>
> INTITIAL_SEG_TEXT, INITIAL_SEG_LONGTEXT, false )<br>
> add_bool( SOUT_CFG_PREFIX "splitanywhere", false,<br>
> SPLITANYWHERE_TEXT, SPLITANYWHERE_LONGTEXT, true )<br>
> add_bool( SOUT_CFG_PREFIX "delsegs", true,<br>
> @@ -153,6 +157,7 @@ static const char *const ppsz_sout_options[] = {<br>
> "key-file",<br>
> "key-loadfile",<br>
> "generate-iv",<br>
> + "initial-segment-number",<br>
> NULL<br>
> };<br>
><br>
> @@ -186,6 +191,7 @@ struct sout_access_out_sys_t<br>
> block_t *block_buffer;<br>
> int i_handle;<br>
> unsigned i_numsegs;<br>
> + unsigned i_initial_segment;<br>
> bool b_delsegs;<br>
> bool b_ratecontrol;<br>
> bool b_splitanywhere;<br>
> @@ -230,6 +236,7 @@ static int Open( vlc_object_t *p_this )<br>
> p_sys->block_buffer = NULL;<br>
><br>
> p_sys->i_numsegs = var_GetInteger( p_access, SOUT_CFG_PREFIX<br>
> "numsegs" );<br>
> + p_sys->i_initial_segment = var_GetInteger( p_access,<br>
SOUT_CFG_PREFIX<br>
> "initial-segment-number" );<br>
> p_sys->b_splitanywhere = var_GetBool( p_access, SOUT_CFG_PREFIX<br>
> "splitanywhere" );<br>
> p_sys->b_delsegs = var_GetBool( p_access, SOUT_CFG_PREFIX "delsegs"<br>
);<br>
> p_sys->b_ratecontrol = var_GetBool( p_access, SOUT_CFG_PREFIX<br>
> "ratecontrol") ;<br>
> @@ -282,7 +289,7 @@ static int Open( vlc_object_t *p_this )<br>
> }<br>
><br>
> p_sys->i_handle = -1;<br>
> - p_sys->i_segment = 0;<br>
> + p_sys->i_segment = p_sys->i_initial_segment > 0 ?<br>
> p_sys->i_initial_segment -1 : 0;<br>
> p_sys->psz_cursegPath = NULL;<br>
><br>
> p_access->pf_write = Write;<br>
> @@ -544,8 +551,11 @@ static int updateIndexAndDel( sout_access_out_t<br>
> *p_access, sout_access_out_sys_t<br>
> uint32_t i_firstseg;<br>
> unsigned i_index_offset = 0;<br>
><br>
> - if ( p_sys->i_numsegs == 0 || p_sys->i_segment < p_sys->i_numsegs )<br>
> - i_firstseg = 1;<br>
> + if ( p_sys->i_numsegs == 0 ||<br>
> + p_sys->i_segment < ( p_sys->i_numsegs +<br>
p_sys->i_initial_segment<br>
> ) )<br>
> + {<br>
> + i_firstseg = p_sys->i_initial_segment == 0 ? 1 :<br>
> p_sys->i_initial_segment;<br>
> + }<br>
> else<br>
> {<br>
> unsigned numsegs = segmentAmountNeeded( p_sys );<br>
<br>
--<br>
</div></div><span class="HOEnZb"><font color="#888888">Rémi Denis-Courmont<br>
Sent from my collocated server<br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
</font></span></blockquote></div><br></div></div>