]> git.sesse.net Git - ffmpeg/commit
avformat/matroskaenc: Simplify writing Void elements
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 12 Jan 2020 00:30:58 +0000 (01:30 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 2 Apr 2020 18:12:00 +0000 (20:12 +0200)
commit98a6c6ec82eae39cffebd16e8862bf269bec1abc
tree742d3859d35ba918e844026d90817958847df7e5
parent8e4c871196adfb16adf64f826c1291a4b0b0af4f
avformat/matroskaenc: Simplify writing Void elements

Reserving space in Matroska works by writing a Void element. And until
now this worked as follows: The current position was recorded and the
EBML ID as well as the length field written; then the new position was
recorded to know how much more to write. Afterwards the actual writing
has been performed via ffio_fill().

But it is unnecessary to explicitly use the positions (obtained via
avio_tell()) to find out how much still needs to be written, because the
length of the ID and the length field are known. So rewrite the function
to no longer use them.

Also, given that ffio_fill() uses an int parameter and given that no
current caller (and no sane future caller) will want to reserve several
GB of space, make the size parameter of put_ebml_void() itself an int.

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