avformat/movenc: don't disable edit lists when writing CMAF output

They are needed for audio tracks with priming samples, where negative CTS
offsets can't be used.

Fixes ticket #11031.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit ecc7d5db9c)
release/7.1
James Almer 1 month ago
parent cb997ccd09
commit 8fa5fa1463
  1. 8
      libavformat/movenc.c

@ -7666,19 +7666,11 @@ static int mov_init(AVFormatContext *s)
s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO) s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO)
mov->use_editlist = 0; 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 && if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV &&
!(mov->flags & FF_MOV_FLAG_DELAY_MOOV) && mov->use_editlist) !(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"); 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 && if (!mov->use_editlist && s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_AUTO &&
!(mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)) !(mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS))
s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_ZERO; s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_ZERO;

Loading…
Cancel
Save