aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-03-18 07:12:05 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-03 20:56:12 +0200
commit9b41fddf3ebd23d465960b523ee34329a5f06c42 (patch)
treef3ea23cefe9f4d412028beae123be8688a86b685 /libavformat
parentf660b8d1de81055df6b081bc910ef159c6ed2642 (diff)
downloadffmpeg-9b41fddf3ebd23d465960b523ee34329a5f06c42.tar.gz
avformat/matroskaenc: Avoid allocation of AVPacket
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskaenc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index f17665b0c1..6945c26f5a 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -453,8 +453,6 @@ static void mkv_deinit(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
- av_packet_free(&mkv->cur_audio_pkt);
-
ffio_free_dyn_buf(&mkv->cluster_bc);
ffio_free_dyn_buf(&mkv->info.bc);
ffio_free_dyn_buf(&mkv->track.bc);
@@ -2682,9 +2680,8 @@ static int mkv_init(struct AVFormatContext *s)
} else
mkv->mode = MODE_MATROSKAv2;
- mkv->cur_audio_pkt = av_packet_alloc();
- if (!mkv->cur_audio_pkt)
- return AVERROR(ENOMEM);
+ mkv->cur_audio_pkt = ffformatcontext(s)->pkt;
+
mkv->tracks = av_calloc(s->nb_streams, sizeof(*mkv->tracks));
if (!mkv->tracks)
return AVERROR(ENOMEM);