diff mbox

[FFmpeg-devel,1/1] flush segments to guarantuee atomic single file hls

Message ID 20190116150332.56301-2-daniel@danieloberhoff.de
State New
Headers show

Commit Message

Daniel Oberhoff Jan. 16, 2019, 3:03 p.m. UTC
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Moritz Barsnick Jan. 19, 2019, 8:51 p.m. UTC | #1
> Subject: flush segments to guarantuee atomic single file hls
                             ^ nit no. 1: guarantee

Nit no. 2: Please use a commit line something like:

avformat/hlsenc: flush segments to guarantee atomic single file hls

(I'm not sure I agree with the wording, but I'm no HLS expert.)

Does this fix some known bug worth mentioning?

Moritz
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index ca57694e9e..2cd651d7e8 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -406,6 +406,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