diff options
author | Charles Liu <liuchh83@gmail.com> | 2018-10-30 11:11:27 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2018-10-30 11:11:27 +0800 |
commit | 1ff4bd59dfcea26b584e8c82a6cd7c3ee87fc8a7 (patch) | |
tree | 8d02991675d1da40858c0873a580ad2b8d8680f6 | |
parent | 76b8e42c1f0453215244c45114d5aa302e2add7b (diff) | |
download | ffmpeg-1ff4bd59dfcea26b584e8c82a6cd7c3ee87fc8a7.tar.gz |
avformat/hlsenc.c: fix the output's duration smaller than input's in sub-range mode.
In fmp4 & sub-range mode, the output's duration always smaller than expected,
because the size of the last #EXT-X-BYTERANGE is too small.
Signed-off-by: Charles Liu <liuchh83@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
-rw-r--r-- | libavformat/hlsenc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 8b3a9b78f4..f8f060d065 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2380,6 +2380,7 @@ static int hls_write_trailer(struct AVFormatContext *s) if (ret < 0) { goto failed; } + vs->size = range_length; ff_format_io_close(s, &vs->out); } @@ -2388,8 +2389,6 @@ failed: if (oc->pb) { if (hls->segment_type != SEGMENT_TYPE_FMP4) { vs->size = avio_tell(vs->avf->pb) - vs->start_pos; - } else { - vs->size = avio_tell(vs->avf->pb); } if (hls->segment_type != SEGMENT_TYPE_FMP4) ff_format_io_close(s, &oc->pb); |