avformat/hlsenc: flush packets before update split message

fix ticket: 7831

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2019-04-14 18:45:23 +08:00
parent 0ad0533e91
commit b18c8688dd
1 changed files with 1 additions and 0 deletions

View 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;