diff mbox series

[FFmpeg-devel,v2,4/5] hlsenc: When not using HLS_SINGLE_FILE, set vs->size to range_length

Message ID 20240626105738.58427-4-martin@martin.st
State Accepted
Headers show
Series [FFmpeg-devel,v2,1/5] hlsenc: Fix the return value accumulation in append_single_file | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Martin Storsjö June 26, 2024, 10:57 a.m. UTC
This matches what is done in the corresponding case for
HLS_SINGLE_FILE.

Normally, vs->size is already initialized correctly - but when
writing the initial segment, with mp4 files, vs->size has been set
to the size of the init segment, while range_length contains the
real size of the first segment.
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index e9aff1d0f7..7c8c886fc3 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2587,6 +2587,7 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
                     av_dict_free(&options);
                     return ret;
                 }
+                vs->size = range_length;
                 ret = hlsenc_io_close(s, &vs->out, filename);
                 if (ret < 0) {
                     av_log(s, AV_LOG_WARNING, "upload segment failed,"