<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><br>Hello,<br><br></div>For an small project I'm developping an livehttp server based on vlc+livehttp and a web server (Apache).<br>
<br></div>The livehttp module works properly but when I add the delsegs option to remove old segment next random raise condition sequence of events arise:<br><br></div><div><span style="font-family:courier new,monospace">Note:</span></div>
<div><span style="font-family:courier new,monospace"><br></span></div><div><span style="font-family:courier new,monospace">1.- Clients requests index.m3u8 index file to apache<br></span></div><div><span style="font-family:courier new,monospace">2.- web-server sends back the index.m3u8 index file to the client<br>
</span></div><div><span style="font-family:courier new,monospace">3.- Client reads the m3u8 and parses it.<br></span></div><div><span style="font-family:courier new,monospace">4.- livehttp creates a new ts segment, updates the index.m3u8 index and removes the oldest existing fragment.<br>
</span></div><div><span style="font-family:courier new,monospace">5.- Client request to the web-server the first ts fragment it founds after parsing (<span style="color:rgb(255,0,0)"><b>this fragment has just been removed in step 4</b></span>)<br>
</span></div><div><span style="font-family:courier new,monospace">6.- web-server returns a <span style="color:rgb(255,0,0)"><b>404-Not Found error</b></span>.</span><br></div><div><br></div></div></div></div></div></div>I think a simple patch in modules/access_output/livehttp.c like the next one will fix the error. <br>
The two oldest files will not be removed inmediatly but just after two other updates:<br><br></div><span style="font-family:courier new,monospace">532c532<br>< if ( p_sys->b_delsegs && i_firstseg > 1 )<br>
---<br>> if ( p_sys->b_delsegs && i_firstseg > 3 )<br>534c534<br>
< char *psz_name = formatSegmentPath( p_access->psz_path, i_firstseg-1, true );<br>---<br>> char *psz_name = formatSegmentPath( p_access->psz_path, i_firstseg-3, true );</span><br><br></div><div>
<div><br></div><div>Regards!<br><br></div><div>Enrique<br></div></div></div>