This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit ea3d417d90e6a8de408701aeb57aad63d5cd70f5
Author:     Stefan Breunig <[email protected]>
AuthorDate: Sun Apr 26 09:19:44 2026 +0200
Commit:     stevenliu <[email protected]>
CommitDate: Tue Jun 23 00:04:42 2026 +0000

    avformat/hlsplaylist: fix byte offsets for single_file+iframes_only
    
    fix ticket: 8636
    
    video_keyframe_size and video_keyframe_pos tracked the end of the
    previous P/B frame. In the case of I-frame only videos, this would
    result in byteoffsets always being 0@0 in the case of fmp4. For
    mpegts, the size would be correct but the pos still always be @0.
    
    Since size and pos already correctly track the start of a segment,
    we can re-use them even in I-frame only mode.
---
 libavformat/dashenc.c     | 2 +-
 libavformat/hlsenc.c      | 4 ++--
 libavformat/hlsplaylist.c | 4 +---
 libavformat/hlsplaylist.h | 1 -
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index a0417dc73e..406ee2cf0d 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -436,7 +436,7 @@ static void write_hls_media_playlist(OutputStream *os, 
AVFormatContext *s,
                                 (double) seg->duration / timescale, 0,
                                 seg->range_length, seg->start_pos, NULL,
                                 c->single_file ? os->initfile : seg->file,
-                                &prog_date_time, 0, 0, 0);
+                                &prog_date_time, 0);
         if (ret < 0) {
             av_log(os->ctx, AV_LOG_WARNING, "ff_hls_write_file_entry get 
error\n");
         }
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 2a4f65a35a..7355801728 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1620,7 +1620,7 @@ static int hls_window(AVFormatContext *s, int last, 
VariantStream *vs)
                                       en->size, en->pos, hls->baseurl,
                                       en->filename,
                                       en->discont_program_date_time ? 
&en->discont_program_date_time : prog_date_time_p,
-                                      en->keyframe_size, en->keyframe_pos, 
hls->flags & HLS_I_FRAMES_ONLY);
+                                      hls->flags & HLS_I_FRAMES_ONLY);
         if (en->discont_program_date_time)
             en->discont_program_date_time -= en->duration;
         if (ret < 0) {
@@ -1644,7 +1644,7 @@ static int hls_window(AVFormatContext *s, int last, 
VariantStream *vs)
         for (en = vs->segments; en; en = en->next) {
             ret = ff_hls_write_file_entry(hls->sub_m3u8_out, en->discont, 
byterange_mode,
                                           en->duration, 0, en->size, en->pos,
-                                          hls->baseurl, en->sub_filename, 
NULL, 0, 0, 0);
+                                          hls->baseurl, en->sub_filename, 
NULL, 0);
             if (ret < 0) {
                 av_log(s, AV_LOG_WARNING, "ff_hls_write_file_entry get 
error\n");
             }
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
index 5c6a384d84..774bc5ac84 100644
--- a/libavformat/hlsplaylist.c
+++ b/libavformat/hlsplaylist.c
@@ -147,7 +147,6 @@ int ff_hls_write_file_entry(AVIOContext *out, int 
insert_discont,
                             int64_t pos /* Used only if HLS_SINGLE_FILE flag 
is set */,
                             const char *baseurl /* Ignored if NULL */,
                             const char *filename, double *prog_date_time,
-                            int64_t video_keyframe_size, int64_t 
video_keyframe_pos,
                             int iframe_mode)
 {
     if (!out || !filename)
@@ -161,8 +160,7 @@ int ff_hls_write_file_entry(AVIOContext *out, int 
insert_discont,
     else
         avio_printf(out, "#EXTINF:%f,\n", duration);
     if (byterange_mode)
-        avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n", iframe_mode 
? video_keyframe_size : size,
-                    iframe_mode ? video_keyframe_pos : pos);
+        avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n", size, pos);
 
     if (prog_date_time) {
         time_t tt, wrongsecs;
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h
index ec44e5a0ae..a9f8bab263 100644
--- a/libavformat/hlsplaylist.h
+++ b/libavformat/hlsplaylist.h
@@ -58,7 +58,6 @@ int ff_hls_write_file_entry(AVIOContext *out, int 
insert_discont,
                             int64_t pos /* Used only if HLS_SINGLE_FILE flag 
is set */,
                             const char *baseurl /* Ignored if NULL */,
                             const char *filename, double *prog_date_time,
-                            int64_t video_keyframe_size, int64_t 
video_keyframe_pos,
                             int iframe_mode);
 void ff_hls_write_end_list (AVIOContext *out);
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to