On Wed, Jul 30, 2014 at 10:30:29AM +0200, Nicolas Martyanoff wrote: > 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().
theres a internal buffer, once its filled data will be flushed out to the OS, which i guess may or may not write data atomically in case of remote FS theres also avio_flush() and AVFMT_FLAG_FLUSH_PACKETS to force earlier flushing so i guess there could be some corner cases where the file is truncated somehow but still it seems better than no file to me [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong.
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel