]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/loco.c
merge read and and in add_paeth_prediction
[ffmpeg] / libavcodec / loco.c
index fc7b44075f43dae29f17e1d2a6e3302c73322f91..8f2b8ff325a440cf5edafd485f36271b91f53750 100644 (file)
  */
 
 /**
- * @file libavcodec/loco.c
+ * @file
  * LOCO codec.
  */
 
 #include "avcodec.h"
-#include "bitstream.h"
+#include "get_bits.h"
 #include "golomb.h"
 #include "mathops.h"
 
@@ -248,7 +248,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
         break;
     default:
         l->lossy = AV_RL32(avctx->extradata + 8);
-        av_log(avctx, AV_LOG_INFO, "This is LOCO codec version %i, please upload file for study\n", version);
+        av_log_ask_for_sample(avctx, "This is LOCO codec version %i.\n", version);
     }
 
     l->mode = AV_RL32(avctx->extradata + 4);
@@ -275,14 +275,24 @@ static av_cold int decode_init(AVCodecContext *avctx){
     return 0;
 }
 
-AVCodec loco_decoder = {
+static av_cold int decode_end(AVCodecContext *avctx){
+    LOCOContext * const l = avctx->priv_data;
+    AVFrame *pic = &l->pic;
+
+    if (pic->data[0])
+        avctx->release_buffer(avctx, pic);
+
+    return 0;
+}
+
+AVCodec ff_loco_decoder = {
     "loco",
-    CODEC_TYPE_VIDEO,
+    AVMEDIA_TYPE_VIDEO,
     CODEC_ID_LOCO,
     sizeof(LOCOContext),
     decode_init,
     NULL,
-    NULL,
+    decode_end,
     decode_frame,
     CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("LOCO"),