]> git.sesse.net Git - ffmpeg/commit
avformat/matroskaenc: Remove unnecessary avio_tell(), avio_seek()
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 22 Jan 2020 17:45:08 +0000 (18:45 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 3 Apr 2020 06:10:57 +0000 (08:10 +0200)
commit0fc150f048398c9dbb8578f25e916fd356c18a54
treeb8b0cb0d22f1093d40832872ab8e972de03b8518
parent4aa0665f393847c35387a1c673e62346d0acfc95
avformat/matroskaenc: Remove unnecessary avio_tell(), avio_seek()

avio_close_dyn_buf() has a bug: When the write pointer does not point to
the end of the written data when calling it (i.e. when one has performed
a seek back to update already written data), it would not add padding to
the end of the buffer, but to the current position, overwriting other
data; furthermore the reported size would be wrong (off by the amount of
data it has overwritten with padding).

In order not to run into this when updating already written elements or
elements for which size has only been reserved, the Matroska muxer would
first record the current position of the dynamic buffer, then seek to
the desired position, perform the update and seek back to the earlier
position.

But now that end_ebml_master_crc32() does not make use of
avio_close_dyn_buf() any more, this is no longer necessary.

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