You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/avienc: Avoid allocating AVPacket
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -272,9 +272,7 @@ static int avi_write_header(AVFormatContext *s)
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
avi->empty_packet = av_packet_alloc();
|
avi->empty_packet = ffformatcontext(s)->pkt;
|
||||||
if (!avi->empty_packet)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
|
|
||||||
for (n = 0; n < s->nb_streams; n++) {
|
for (n = 0; n < s->nb_streams; n++) {
|
||||||
s->streams[n]->priv_data = av_mallocz(sizeof(AVIStream));
|
s->streams[n]->priv_data = av_mallocz(sizeof(AVIStream));
|
||||||
@@ -972,10 +970,6 @@ static int avi_write_trailer(AVFormatContext *s)
|
|||||||
|
|
||||||
static void avi_deinit(AVFormatContext *s)
|
static void avi_deinit(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
AVIContext *avi = s->priv_data;
|
|
||||||
|
|
||||||
av_packet_free(&avi->empty_packet);
|
|
||||||
|
|
||||||
for (int i = 0; i < s->nb_streams; i++) {
|
for (int i = 0; i < s->nb_streams; i++) {
|
||||||
AVIStream *avist = s->streams[i]->priv_data;
|
AVIStream *avist = s->streams[i]->priv_data;
|
||||||
if (!avist)
|
if (!avist)
|
||||||
|
Reference in New Issue
Block a user