]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/flashsv.c
Declare WMV1/WMV2/VC-1 decoder dependency on the H.263 decoder in configure.
[ffmpeg] / libavcodec / flashsv.c
index 91c04996eb508b60e8b7a598b0d8f3687141a274..8870fe63a8a2c6581a92444afa7c7881feb0614a 100644 (file)
@@ -51,7 +51,7 @@
 #include <stdlib.h>
 
 #include "avcodec.h"
-#include "bitstream.h"
+#include "get_bits.h"
 
 #include <zlib.h>
 
@@ -114,9 +114,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
     if (buf_size == 0)
         return 0;
 
-    if(s->frame.data[0])
-            avctx->release_buffer(avctx, &s->frame);
-
     init_get_bits(&gb, buf, buf_size * 8);
 
     /* start to parse the bitstream */
@@ -162,10 +159,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
         h_blocks, v_blocks, h_part, v_part);
 
     s->frame.reference = 1;
-    s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
-    if (avctx->get_buffer(avctx, &s->frame) < 0) {
-        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return -1;
+    s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
+    if(avctx->reget_buffer(avctx, &s->frame) < 0){
+      av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
+      return -1;
     }
 
     /* loop over all block columns */
@@ -256,6 +253,6 @@ AVCodec flashsv_decoder = {
     flashsv_decode_end,
     flashsv_decode_frame,
     CODEC_CAP_DR1,
-    .pix_fmts = (enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_NONE},
+    .pix_fmts = (const enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),
 };