]> git.sesse.net Git - ffmpeg/commit
avformat/matroskaenc: Improve BlockAdditions
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 20 Nov 2019 14:10:34 +0000 (15:10 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 3 Apr 2020 07:04:22 +0000 (09:04 +0200)
commit52523b69638967341a8c211c11b1cdb5d3978f78
treee4dcc48f6ad460e75e1c0d4620b0eb72b0226745
parentaf97a3a4d6b9d199654ab6328c79e6be808ce6f9
avformat/matroskaenc: Improve BlockAdditions

8ffcc826 added support for muxing BlockAdditions with BlockAddID equal
to one. The restriction to BlockAddID == 1 probably resulted from
a limitation to what was needed; yet over time this led to three
occurences of "(side_data_size && additional_id == 1)". This commit
changes this by setting side_data_size to 0 if additional_id != 1.

It also stops hardcoding 1 for the value of BlockAddID to write;
but it still upholds the requirement that it is 1. See below.

Despite BlockAddId actually having a default value of 1, it is still
written, because until very recently (namely dbc50f8a) our demuxer
used a wrong default value of 0.

Furthermore, use put_ebml_binary() to write the BlockAdditional element.

(The Matroska specifications have evolved and now the BlockAddID 1 is
reserved for the codec (as described in the codec's codec mapping),
BlockMore elements with BlockAddID > 1 are now of a more
codec-independent nature and require a BlockAdditionalMapping in the
track's TrackEntry. Given that this muxer does not support writing said
BlockAdditionalMapping yet (actually, none have been defined yet), we
have to uphold the requirement that BlockAddID == 1.)

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