]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/yuv4enc.c
Merge commit '43dd004747fa697396b47d034a80e069facbea09'
[ffmpeg] / libavcodec / yuv4enc.c
index 5ce48467d194d1915129a3754eaad1ce786ae229..17c670f40694d8646f089943a0a0328e4e073893 100644 (file)
 
 static av_cold int yuv4_encode_init(AVCodecContext *avctx)
 {
-    avctx->coded_frame = av_frame_alloc();
-
-    if (!avctx->coded_frame) {
-        av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
-        return AVERROR(ENOMEM);
-    }
-
     return 0;
 }
 
@@ -42,7 +35,7 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     uint8_t *y, *u, *v;
     int i, j, ret;
 
-    if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1))) < 0)
+    if ((ret = ff_alloc_packet2(avctx, pkt, 6 * (avctx->width + 1 >> 1) * (avctx->height + 1 >> 1), 0)) < 0)
         return ret;
     dst = pkt->data;
 
@@ -74,8 +67,6 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int yuv4_encode_close(AVCodecContext *avctx)
 {
-    av_frame_free(&avctx->coded_frame);
-
     return 0;
 }