]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/avrndec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / avrndec.c
index 2205a422e2df849f7a279970bc05aac219566c3e..0fc431d4da92ac3d5b60f11c7d800481da1af91e 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "avcodec.h"
+#include "internal.h"
 #include "mjpeg.h"
 #include "mjpegdec.h"
 #include "libavutil/imgutils.h"
@@ -79,7 +80,8 @@ static av_cold int end(AVCodecContext *avctx)
     return 0;
 }
 
-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)
 {
     AVRnContext *a = avctx->priv_data;
     AVFrame *p = &a->frame;
@@ -88,7 +90,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     int y, ret, true_height;
 
     if(a->is_mjpeg)
-        return ff_mjpeg_decode_frame(avctx, data, data_size, avpkt);
+        return ff_mjpeg_decode_frame(avctx, data, got_frame, avpkt);
 
     true_height    = buf_size / (2*avctx->width);
     if(p->data[0])
@@ -99,7 +101,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
         return AVERROR_INVALIDDATA;
     }
 
-    if((ret = avctx->get_buffer(avctx, p)) < 0){
+    if((ret = ff_get_buffer(avctx, p)) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
@@ -122,7 +124,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     }
 
     *(AVFrame*)data = a->frame;
-    *data_size      = sizeof(AVFrame);
+    *got_frame      = 1;
     return buf_size;
 }