summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-18 23:05:27 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-27 12:55:41 +0100
commita81e0ee21f64213e750ccb10128775337c73431d (patch)
tree9e3e2618412885167c6b40a9faef261fdcd985f0 /libavformat
parent5e01fc83181edb0bccc480f3c7f48ea928d8e444 (diff)
avformat/movenc: Avoid allocation of AVPacket
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 9886bc7b64..38ff90833a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6458,8 +6458,6 @@ static void mov_free(AVFormatContext *s)
MOVMuxContext *mov = s->priv_data;
int i;
- av_packet_free(&mov->pkt);
-
if (!mov->tracks)
return;
@@ -6569,6 +6567,7 @@ static int mov_init(AVFormatContext *s)
int i, ret;
mov->fc = s;
+ mov->pkt = ffformatcontext(s)->pkt;
/* Default mode == MP4 */
mov->mode = MODE_MP4;
@@ -6714,10 +6713,6 @@ static int mov_init(AVFormatContext *s)
mov->nb_streams += mov->nb_meta_tmcd;
}
- mov->pkt = av_packet_alloc();
- if (!mov->pkt)
- return AVERROR(ENOMEM);
-
// Reserve an extra stream for chapters for the case where chapters
// are written in the trailer
mov->tracks = av_calloc(mov->nb_streams + 1, sizeof(*mov->tracks));