summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2019-11-26 09:25:02 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-19 12:25:13 +0100
commite3c2a97a6d4e24d19f419325057ca2ab2fa37961 (patch)
tree5df29d0a8457c34a4c125c7bede4e0c19a5d7cef
parent48ff1ba68762a869d4d8ea66b4e045779fb82555 (diff)
avformat/matroskaenc: Write data directly into dynamic buffers
This avoids copying the data in small chunks (1024B) into the dynamic buffer's small buffer before finally writing them into the "big" buffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavformat/matroskaenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index c8a8e31030..8c10a8c133 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2721,6 +2721,7 @@ static int mkv_write_packet_internal(AVFormatContext *s, const AVPacket *pkt)
ret = start_ebml_master_crc32(&mkv->cluster_bc, mkv);
if (ret < 0)
return ret;
+ mkv->cluster_bc->direct = 1;
mkv->cluster_pos = avio_tell(s->pb);
put_ebml_uint(mkv->cluster_bc, MATROSKA_ID_CLUSTERTIMECODE, FFMAX(0, ts));
mkv->cluster_pts = FFMAX(0, ts);