You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/movenc: Avoid allocation of AVPacket
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -6458,8 +6458,6 @@ static void mov_free(AVFormatContext *s)
|
|||||||
MOVMuxContext *mov = s->priv_data;
|
MOVMuxContext *mov = s->priv_data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
av_packet_free(&mov->pkt);
|
|
||||||
|
|
||||||
if (!mov->tracks)
|
if (!mov->tracks)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -6569,6 +6567,7 @@ static int mov_init(AVFormatContext *s)
|
|||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
mov->fc = s;
|
mov->fc = s;
|
||||||
|
mov->pkt = ffformatcontext(s)->pkt;
|
||||||
|
|
||||||
/* Default mode == MP4 */
|
/* Default mode == MP4 */
|
||||||
mov->mode = MODE_MP4;
|
mov->mode = MODE_MP4;
|
||||||
@@ -6714,10 +6713,6 @@ static int mov_init(AVFormatContext *s)
|
|||||||
mov->nb_streams += mov->nb_meta_tmcd;
|
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
|
// Reserve an extra stream for chapters for the case where chapters
|
||||||
// are written in the trailer
|
// are written in the trailer
|
||||||
mov->tracks = av_calloc(mov->nb_streams + 1, sizeof(*mov->tracks));
|
mov->tracks = av_calloc(mov->nb_streams + 1, sizeof(*mov->tracks));
|
||||||
|
Reference in New Issue
Block a user