]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rpza.c
vp56: release frames on error
[ffmpeg] / libavcodec / rpza.c
index 59c3a7b3a7210475f5abd4338cb28d003a58bd65..57d4d2d228841df9d013226a8907bb3d85749eea 100644 (file)
@@ -38,6 +38,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
@@ -235,7 +236,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx)
     RpzaContext *s = avctx->priv_data;
 
     s->avctx = avctx;
-    avctx->pix_fmt = PIX_FMT_RGB555;
+    avctx->pix_fmt = AV_PIX_FMT_RGB555;
 
     s->frame.data[0] = NULL;
 
@@ -243,7 +244,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx)
 }
 
 static int rpza_decode_frame(AVCodecContext *avctx,
-                             void *data, int *data_size,
+                             void *data, int *got_frame,
                              AVPacket *avpkt)
 {
     const uint8_t *buf = avpkt->data;
@@ -262,7 +263,7 @@ static int rpza_decode_frame(AVCodecContext *avctx,
 
     rpza_decode_stream(s);
 
-    *data_size = sizeof(AVFrame);
+    *got_frame      = 1;
     *(AVFrame*)data = s->frame;
 
     /* always report that the buffer was completely consumed */
@@ -282,11 +283,11 @@ static av_cold int rpza_decode_end(AVCodecContext *avctx)
 AVCodec ff_rpza_decoder = {
     .name           = "rpza",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_RPZA,
+    .id             = AV_CODEC_ID_RPZA,
     .priv_data_size = sizeof(RpzaContext),
     .init           = rpza_decode_init,
     .close          = rpza_decode_end,
     .decode         = rpza_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"),
+    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"),
 };