History

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.

James Almer committed 1 year ago

Commit ecc7d5d1 parent 865c73c1 file · +0 −8Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/movenc.c+0−8
@@ -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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t