]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/targa_y216dec.c
gifdec: port to bytestream2 API
[ffmpeg] / libavcodec / targa_y216dec.c
index bac5aeeddf3a61659f0b7da52da15842cc621f71..3b97000c534b0b8e306448a642e89e33a929232e 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "avcodec.h"
+#include "internal.h"
 
 static av_cold int y216_decode_init(AVCodecContext *avctx)
 {
@@ -37,7 +38,7 @@ static av_cold int y216_decode_init(AVCodecContext *avctx)
 }
 
 static int y216_decode_frame(AVCodecContext *avctx, void *data,
-                             int *data_size, AVPacket *avpkt)
+                             int *got_frame, AVPacket *avpkt)
 {
     AVFrame *pic = avctx->coded_frame;
     const uint16_t *src = (uint16_t *)avpkt->data;
@@ -54,7 +55,7 @@ static int y216_decode_frame(AVCodecContext *avctx, void *data,
 
     pic->reference = 0;
 
-    if (avctx->get_buffer(avctx, pic) < 0) {
+    if (ff_get_buffer(avctx, pic) < 0) {
         av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
         return AVERROR(ENOMEM);
     }
@@ -80,7 +81,7 @@ static int y216_decode_frame(AVCodecContext *avctx, void *data,
         src += aligned_width << 1;
     }
 
-    *data_size = sizeof(AVFrame);
+    *got_frame = 1;
     *(AVFrame *)data = *pic;
 
     return avpkt->size;