]> git.sesse.net Git - ffmpeg/commit
avformat/matroskaenc: Simplify writing buffer
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 29 Apr 2020 18:33:06 +0000 (20:33 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 6 May 2020 08:38:53 +0000 (10:38 +0200)
commit8370c9c206367acaec1130fe47582590123b1b64
tree39347fd68b59cc4c64683b6dd85aa4410f188c89
parent3122dcf2fe54c427aecdbba2ee85788981e3236b
avformat/matroskaenc: Simplify writing buffer

If one already has the contents of a master elements in a buffer of
known size, then writing a EBML master element is no different from
writing an EBML binary element. It is overtly complicated to use
start/end_ebml_master() as these functions first write an unkown-length
size field of the appropriate length, then write the buffer's contents,
followed by a seek to the length field to overwrite it with the real
size (obtained via avio_tell() although it was already known in
advance), followed by another seek to the previous position. Just use
put_ebml_binary() instead.

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