Hi all,

This makes sure segments published in the playlist of a single file hls 
recording are actually visible in the filesystem before the playlist entry. 
Otherwise there is a tiny race condition where a read to a piblished segment 
may fail.


from c309a535a865be70682885aa3b3bffcede41d85c Mon Sep 17 00:00:00 2001
From: Daniel Oberhoff <dan...@danieloberhoff.de>
Date: Wed, 16 Jan 2019 15:58:52 +0100
Subject: [PATCH] flush segments to guarantuee atomic single file hls

---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index d7a4cd2cc4..b0e0ce2300 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -461,6 +461,7 @@ static int flush_dynbuf(VariantStream *vs, int 
*range_length)
     *range_length = avio_close_dyn_buf(ctx->pb, &buffer);
     ctx->pb = NULL;
     avio_write(vs->out, buffer, *range_length);
+    avio_flush(vs->out);
     av_free(buffer);

     // re-open buffer
--
2.22.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to