avformat/matroskaenc: Avoid allocation of AVPacket

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-03-18 07:12:05 +01:00
parent f660b8d1de
commit 9b41fddf3e

View File

@ -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);