diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2017-03-04 09:27:56 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2017-03-04 09:27:56 +0800 |
commit | 4507f29e4a6a4363e0179c02bdb78d55e4d9a12c (patch) | |
tree | 4369872a8f9e64ac14af1fe019b8031ca3ab8981 /libavformat/hlsenc.c | |
parent | 68ee800a9dd9808d6b5c8b52963cd19cfdd4753e (diff) | |
download | ffmpeg-4507f29e4a6a4363e0179c02bdb78d55e4d9a12c.tar.gz |
avformat/hlsenc: move the segment files handler close to before temp flags process
fix ticket: #6204
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r-- | libavformat/hlsenc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 9cf621125c..b8122f1a37 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1329,13 +1329,14 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) new_start_pos = avio_tell(hls->avf->pb); hls->size = new_start_pos - hls->start_pos; + ff_format_io_close(s, &oc->pb); + if (hls->vtt_avf) { + ff_format_io_close(s, &hls->vtt_avf->pb); + } if ((hls->flags & HLS_TEMP_FILE) && oc->filename[0]) { if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <= 0)) if (hls->avf->oformat->priv_class && hls->avf->priv_data) av_opt_set(hls->avf->priv_data, "mpegts_flags", "resend_headers", 0); - ff_format_io_close(s, &oc->pb); - if (hls->vtt_avf) - ff_format_io_close(s, &hls->vtt_avf->pb); hls_rename_temp_file(s, oc); } |