[FFmpeg-devel] [PATCH] avformat/movenc: don't disable edit lists when writing CMAF output

James Almer jamrial at gmail.com
Sat Nov 16 01:14:37 EET 2024


They are needed for audio tracks with priming samples, where negative CTS offsets
are not used.

Fixes ticket #11031.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/movenc.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 73cc6f5845..b24f6cb18d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7671,19 +7671,11 @@ static int mov_init(AVFormatContext *s)
                 s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO)
                 mov->use_editlist = 0;
         }
-        if (mov->flags & FF_MOV_FLAG_CMAF) {
-            // CMAF Track requires negative cts offsets without edit lists
-            mov->use_editlist = 0;
-        }
     }
     if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV &&
         !(mov->flags & FF_MOV_FLAG_DELAY_MOOV) && mov->use_editlist)
         av_log(s, AV_LOG_WARNING, "No meaningful edit list will be written when using empty_moov without delay_moov\n");
 
-    if (mov->flags & FF_MOV_FLAG_CMAF && mov->use_editlist) {
-        av_log(s, AV_LOG_WARNING, "Edit list enabled; Assuming writing CMAF Track File\n");
-        mov->flags &= ~FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS;
-    }
     if (!mov->use_editlist && s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_AUTO &&
         !(mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS))
         s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_ZERO;
-- 
2.47.0



More information about the ffmpeg-devel mailing list