From: yu.dongliang <18588496441@163.com> Date: Mon, 10 Apr 2023 10:44:15 +0000 (+0800) Subject: tmp X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=360a09245320d2a35c6c63528cb5b91571255351;p=simplay.git tmp --- diff --git a/simp_ffmpeg_output.c b/simp_ffmpeg_output.c index f21e1fe..8e3c1b2 100644 --- a/simp_ffmpeg_output.c +++ b/simp_ffmpeg_output.c @@ -51,6 +51,10 @@ static int _video_init(simp_ffmpeg_t* priv) return ret; } + priv->vframe = av_frame_alloc(); + if (!priv->vframe) + return -ENOMEM; + priv->vpkt = av_packet_alloc(); if (!priv->vpkt) return -ENOMEM; @@ -176,6 +180,18 @@ error: if (priv->afifo) av_audio_fifo_free(priv->afifo); + if (priv->vframe) + av_frame_free(&priv->vframe); + + if (priv->aframe) + av_frame_free(&priv->aframe); + + if (priv->vpkt) + av_packet_free(&priv->vpkt); + + if (priv->apkt) + av_packet_free(&priv->apkt); + free(priv); return ret; }