tmp
authoryu.dongliang <18588496441@163.com>
Mon, 10 Apr 2023 10:44:15 +0000 (18:44 +0800)
committeryu.dongliang <18588496441@163.com>
Mon, 10 Apr 2023 10:44:15 +0000 (18:44 +0800)
simp_ffmpeg_output.c

index f21e1fe77f04bfddf58e6f4f3aa4b81819ddada8..8e3c1b2e9af8b8534dd91818aa06a6b5f1f6f450 100644 (file)
@@ -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;
 }