diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-16 08:29:59 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-19 02:36:58 +0100 |
commit | e318438f2f30525d8baca2b5683aa9898d0c56f7 (patch) | |
tree | bdea751e87591c0635fd4c8eb04280f6556276ea /libavformat/matroskaenc.c | |
parent | e1e6a5c8a515afa488faee3200666ce0f14ea5eb (diff) |
avformat: Make AVChapter.id an int64_t on next major bump
64 bits are needed in order to retain the uid values of Matroska
chapters; the type is kept signed because the semantics of NUT chapters
depend upon whether the id is > 0 or < 0.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 012da9e538..bbf231f2a4 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1669,7 +1669,11 @@ static int mkv_write_chapters(AVFormatContext *s) int64_t chapterstart = av_rescale_q(c->start, c->time_base, scale); int64_t chapterend = av_rescale_q(c->end, c->time_base, scale); const AVDictionaryEntry *t; +#if FF_API_CHAPTER_ID_INT uint64_t uid = create_new_ids ? i + 1ULL : (uint32_t)c->id; +#else + uint64_t uid = create_new_ids ? i + 1ULL : c->id; +#endif if (chapterstart < 0 || chapterstart > chapterend || chapterend < 0) { av_log(s, AV_LOG_ERROR, "Invalid chapter start (%"PRId64") or end (%"PRId64").\n", |