]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/kgv1dec.c
Merge commit 'f1d8763a02b5fce9a7d9789e049d74a45b15e1e8'
[ffmpeg] / libavcodec / kgv1dec.c
index 6c1daa90b7c8ebf42bd035c9b6e334dc979d8c15..019963682259bdddfbe69c1bcbf316aaffcc2604 100644 (file)
@@ -28,6 +28,7 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/imgutils.h"
 #include "avcodec.h"
+#include "internal.h"
 
 typedef struct {
     AVCodecContext *avctx;
@@ -42,7 +43,8 @@ static void decode_flush(AVCodecContext *avctx)
         avctx->release_buffer(avctx, &c->prev);
 }
 
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
+static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
+                        AVPacket *avpkt)
 {
     const uint8_t *buf = avpkt->data;
     const uint8_t *buf_end = buf + avpkt->size;
@@ -71,7 +73,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     maxcnt = w * h;
 
     c->cur.reference = 3;
-    if ((res = avctx->get_buffer(avctx, &c->cur)) < 0)
+    if ((res = ff_get_buffer(avctx, &c->cur)) < 0)
         return res;
     out  = (uint16_t *) c->cur.data[0];
     if (c->prev.data[0]) {
@@ -154,7 +156,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     if (outcnt - maxcnt)
         av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt);
 
-    *data_size = sizeof(AVFrame);
+    *got_frame = 1;
     *(AVFrame*)data = c->cur;
 
     if (c->prev.data[0])