They are needed for audio tracks with priming samples, where negative CTS offsets can't be used. Fixes ticket #11031.
Unified · Split
| @@ -7675,19 +7675,11 @@ static int mov_init(AVFormatContext *s) · 7674 unmodified lines | |||
| 7675 | s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO) | 7675 | s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO) |
| 7676 | mov->use_editlist = 0; | 7676 | mov->use_editlist = 0; |
| 7677 | } | 7677 | } |
| 7678 | if (mov->flags & FF_MOV_FLAG_CMAF) { | ||
| 7679 | // CMAF Track requires negative cts offsets without edit lists | ||
| 7680 | mov->use_editlist = 0; | ||
| 7681 | } | ||
| 7682 | } | 7678 | } |
| 7683 | if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV && | 7679 | if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV && |
| 7684 | !(mov->flags & FF_MOV_FLAG_DELAY_MOOV) && mov->use_editlist) | 7680 | !(mov->flags & FF_MOV_FLAG_DELAY_MOOV) && mov->use_editlist) |
| 7685 | av_log(s, AV_LOG_WARNING, "No meaningful edit list will be written when using empty_moov without delay_moov\n"); | 7681 | av_log(s, AV_LOG_WARNING, "No meaningful edit list will be written when using empty_moov without delay_moov\n"); |
| 7686 | 7682 | ||
| 7687 | if (mov->flags & FF_MOV_FLAG_CMAF && mov->use_editlist) { | ||
| 7688 | av_log(s, AV_LOG_WARNING, "Edit list enabled; Assuming writing CMAF Track File\n"); | ||
| 7689 | mov->flags &= ~FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS; | ||
| 7690 | } | ||
| 7691 | if (!mov->use_editlist && s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_AUTO && | 7683 | if (!mov->use_editlist && s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_AUTO && |
| 7692 | !(mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)) | 7684 | !(mov->flags & FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS)) |
| 7693 | s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_ZERO; | 7685 | s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_ZERO; |