avformat/matroskaenc: Avoid allocation for small dynamic buffers
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 27 Nov 2019 12:22:10 +0000 (13:22 +0100)
committerJames Almer <jamrial@gmail.com>
Thu, 28 Nov 2019 18:20:37 +0000 (15:20 -0300)
commit3a58ec7c772563fbacba63289aa49bc56a496e3f
treeb5029f86c9ac1ebc376c8e2175c665bb4885a567
parentaad82270b60ad244330a137457f5a227fac9b175
avformat/matroskaenc: Avoid allocation for small dynamic buffers

By using avio_get_dyn_buf() + ffio_free_dyn_buf() instead of
avio_close_dyn_buf() + av_free() one can avoid an allocation + copy for
small dynamic buffers (i.e. small master elements).

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