]> git.sesse.net Git - ffmpeg/commit
avformat/matroskaenc: Check chapter ids for duplicates
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 15 Mar 2021 20:17:25 +0000 (21:17 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 19 Mar 2021 01:31:49 +0000 (02:31 +0100)
commite1e6a5c8a515afa488faee3200666ce0f14ea5eb
tree7a7b0693dd393f27f490e254ecdc7fac839d763d
parent578539564a3d3e17dc629d73688797c308c08c9e
avformat/matroskaenc: Check chapter ids for duplicates

Up until now, there has been no check that each chapter has a unique id;
there was only a check for whether a chapter id is zero (this happens
often when the chapters originated from a format that lacks the concept
of chapter id and simply counts from zero) which is invalid in Matroska.
In this case the chapter ids are offset by 1 to make them nonnegative.
Yet offsetting won't fix duplicate ids, therefore this is changed to
simply create new chapter uids when the input chapter uids don't conform
to the requirements of Matroska (in which case it can be presumed that
they did not originate from Matroska, so that we don't need to bother
to preserve them).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/matroskaenc.c