<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma, 'new york', times, serif;font-size:10pt"><div>Hi,</div><div>Would httplive module's developers, please, take a look at issue in <a href="http://mailman.videolan.org/pipermail/vlc/2011-February/019867.html">http://mailman.videolan.org/pipermail/vlc/2011-February/019867.html</a></div><div><br></div><div>Thanks</div><div style="font-family:tahoma, new york, times, serif;font-size:10pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Jean-Paul Saman <jpsaman@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> Mailing list for VLC media player developers <vlc-devel@videolan.org><br><b><span style="font-weight: bold;">Sent:</span></b> Fri, February 11, 2011 2:00:23 PM<br><b><span
style="font-weight: bold;">Subject:</span></b> Re: [vlc-devel] [vlc-commits] stream_filter/httplive.c: read a HLS m3u8 file in one go, parse later<br></font><br>
On Fri, Feb 11, 2011 at 10:32 AM, Laurent Aimar <<a ymailto="mailto:fenrir@elivagar.org" href="mailto:fenrir@elivagar.org">fenrir@elivagar.org</a>> wrote:<br>> Hi,<br>><br>> On Fri, Feb 11, 2011 at 10:14:07AM +0100, Jean-Paul Saman wrote:<br>>> +/* Read M3U8 file */<br>>> +static uint8_t *access_ReadM3U8(stream_t *s, vlc_url_t *url)<br>>> +{<br>>> + stream_sys_t *p_sys = (stream_sys_t *) s->p_sys;<br>>> +<br>>> + /* Download new playlist file from server */<br>>> + if (AccessOpen(s, url) != VLC_SUCCESS)<br>>> + return NULL;<br>>> +<br>>> + ssize_t size = p_sys->p_access->info.i_size;<br>>> + if (size == 0) size = 1024; /* no Content-Length */<br>>> +<br>>> + msg_Err(s, "Stream size is %"PRId64, size);<br>>> +<br>>> + uint8_t
*buffer = calloc(1, size);<br>>> + if (buffer == NULL)<br>>> + {<br>>> + AccessClose(s);<br>>> + return NULL;<br>>> + }<br>>> +<br>>> + size_t length = 0, curlen = 0;<br>>> + do<br>>> + {<br>>> + length = p_sys->p_access->pf_read(p_sys->p_access, buffer + curlen, size - curlen);<br>>> + if ((length <= 0) || (length >= size))<br>>> + break;<br>>> + curlen += length;<br>>> + if (curlen >= size)<br>>> + {<br>>> + uint8_t *tmp = realloc(*buffer, size + 1024);<br>>> +
if (tmp == NULL)<br>>> + break;<br>>> + size += 1024;<br>>> + *buffer = tmp;<br>>> + }<br>>> + } while (vlc_object_alive(s));<br>>> +<br>>> + AccessClose(s);<br>>> + return buffer;<br>>> +}<br>> Is there a specific reason for using access_t? If you open a stream_t directly<br>> it should simplify the code (here and when reading the data segment too).<br><br>I have no idea how that works. AFAIK you cannot reopen an input with a<br>different URL.<br><br>Kind Regards,<br><br>Jean-Paul Saman<br>_______________________________________________<br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><span><a target="_blank"
href="http://mailman.videolan.org/listinfo/vlc-devel">http://mailman.videolan.org/listinfo/vlc-devel</a></span><br></div></div><div style="position:fixed"></div>
</div><br>
</body></html>