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

Martin Storsjö martin at martin.st
Mon Jun 24 11:49:43 EEST 2024


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 --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 0c72774e29..3ca99abdbb 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2586,6 +2586,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,"
-- 
2.39.3 (Apple Git-146)



More information about the ffmpeg-devel mailing list