avformat/hlsenc: flush packets before update split message
authorSteven Liu <lq@chinaffmpeg.org>
Sun, 14 Apr 2019 10:45:23 +0000 (18:45 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Sun, 14 Apr 2019 10:45:23 +0000 (18:45 +0800)
fix ticket: 7831

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index 5f9a200..6b913be 100644 (file)
@@ -2241,6 +2241,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
 
         new_start_pos = avio_tell(vs->avf->pb);
         if (hls->segment_type != SEGMENT_TYPE_FMP4) {
+            avio_flush(oc->pb);
             vs->size = new_start_pos - vs->start_pos;
         } else {
             vs->size = new_start_pos;