[FFmpeg-devel] [PATCH 4/7] avformat/hlsenc: do not regenerate the playlist for each segment

Nicolas Martyanoff khaelin at gmail.com
Wed Jul 30 10:30:29 CEST 2014


On 2014-07-29 15:59, Michael Niedermayer wrote:
> On Fri, Jul 18, 2014 at 10:57:44AM +0200, Nicolas Martyanoff wrote:
> > Since we need all segments to find out the target duration, we can only
> > generate the playlist after writing all segments.
> > 
> > There is no need to rewrite the segment list every time we create a new
> > segment file.
> 
> doesnt this break playing back hls while its still written ?

I believe you are right, I did not thing about the case where a client is
reading the playlist while it is being written.

However I am not sure about the way avio_* functions work. Depending on the
way buffering is done, how does one guarantee that at a time T, the playlist
is a valid HLS playlist ?

The hlsenc muxer uses avio_open2(), a bunch of avio_printf() then
avio_closep(). I have no idea whether a part of the file is readable by other
processed before the call to avio_closep().


-- 
Nicolas Martyanoff
http://wandrian.net
khaelin at gmail.com


More information about the ffmpeg-devel mailing list