[FFmpeg-devel] [PATCH] Try to set AVFrame.reference to correct values.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Nov 5 19:50:07 CET 2011


I am not sure these new values are correct, not am I sure
the semantics are a good idea since we do not seem to make any
use of them but they caused a lot of confusion, but this
seems to make things closer to matching the documentation.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavcodec/4xm.c           |    4 ++--
 libavcodec/aasc.c          |    2 +-
 libavcodec/anm.c           |    2 +-
 libavcodec/avs.c           |    2 +-
 libavcodec/bethsoftvideo.c |    2 +-
 libavcodec/bfi.c           |    2 +-
 libavcodec/c93.c           |    2 +-
 libavcodec/cinepak.c       |    2 +-
 libavcodec/cscd.c          |    2 +-
 libavcodec/eacmv.c         |    2 +-
 libavcodec/eamad.c         |    2 +-
 libavcodec/eatgv.c         |    2 +-
 libavcodec/flicvideo.c     |    4 ++--
 libavcodec/fraps.c         |    8 ++++----
 libavcodec/iff.c           |    2 +-
 libavcodec/indeo2.c        |    2 +-
 libavcodec/kmvc.c          |    2 +-
 libavcodec/mimic.c         |    2 +-
 libavcodec/mmvideo.c       |    2 +-
 libavcodec/motionpixels.c  |    2 +-
 libavcodec/msrle.c         |    2 +-
 libavcodec/msvideo1.c      |    2 +-
 libavcodec/pngdec.c        |    2 +-
 libavcodec/qtrle.c         |    2 +-
 libavcodec/rpza.c          |    2 +-
 libavcodec/smacker.c       |    2 +-
 libavcodec/smc.c           |    2 +-
 libavcodec/snow.c          |    2 +-
 libavcodec/tiertexseqv.c   |    2 +-
 libavcodec/truemotion1.c   |    2 +-
 libavcodec/truemotion2.c   |    2 +-
 libavcodec/tscc.c          |    2 +-
 libavcodec/ulti.c          |    2 +-
 libavcodec/utvideo.c       |    2 +-
 libavcodec/vb.c            |    2 +-
 libavcodec/vmdav.c         |    2 +-
 libavcodec/vmnc.c          |    2 +-
 libavcodec/vp56.c          |    2 +-
 libavcodec/xxan.c          |    2 +-
 libavcodec/zmbv.c          |    2 +-
 40 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index e6638c7..9350f06 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -821,7 +821,7 @@ static int decode_frame(AVCodecContext *avctx,
 
     avctx->flags |= CODEC_FLAG_EMU_EDGE; // alternatively we would have to use our own buffer management
 
-    p->reference= 1;
+    p->reference= 3;
     if (avctx->reget_buffer(avctx, p) < 0) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
         return -1;
@@ -841,7 +841,7 @@ static int decode_frame(AVCodecContext *avctx,
         }
     }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
         if(!f->last_picture.data[0]){
-            f->last_picture.reference= 1;
+            f->last_picture.reference= 3;
             if(avctx->get_buffer(avctx, &f->last_picture) < 0){
                 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                 return -1;
diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c
index f0407bc..919bbc7 100644
--- a/libavcodec/aasc.c
+++ b/libavcodec/aasc.c
@@ -65,7 +65,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
     AascContext *s = avctx->priv_data;
     int compr, i, stride;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index 188f829..5493be6 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -45,7 +45,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return -1;
 
     avcodec_get_frame_defaults(&s->frame);
-    s->frame.reference = 1;
+    s->frame.reference = 3;
 
     buf = avctx->extradata + 16*8;
     for (i = 0; i < 256; i++)
diff --git a/libavcodec/avs.c b/libavcodec/avs.c
index 9e73695..cf965b3 100644
--- a/libavcodec/avs.c
+++ b/libavcodec/avs.c
@@ -63,7 +63,7 @@ avs_decode_frame(AVCodecContext * avctx,
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
         return -1;
     }
-    p->reference = 1;
+    p->reference = 3;
     p->pict_type = AV_PICTURE_TYPE_P;
     p->key_frame = 0;
 
diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c
index fa2db05..9491abd 100644
--- a/libavcodec/bethsoftvideo.c
+++ b/libavcodec/bethsoftvideo.c
@@ -40,7 +40,7 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
 {
     BethsoftvidContext *vid = avctx->priv_data;
     avcodec_get_frame_defaults(&vid->frame);
-    vid->frame.reference = 1;
+    vid->frame.reference = 3;
     vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID |
         FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     avctx->pix_fmt = PIX_FMT_PAL8;
diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
index 1f31d7f..8f4770e 100644
--- a/libavcodec/bfi.c
+++ b/libavcodec/bfi.c
@@ -61,7 +61,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
     if (bfi->frame.data[0])
         avctx->release_buffer(avctx, &bfi->frame);
 
-    bfi->frame.reference = 1;
+    bfi->frame.reference = 3;
 
     if (avctx->get_buffer(avctx, &bfi->frame) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/c93.c b/libavcodec/c93.c
index 2a36ed9..72dcfee 100644
--- a/libavcodec/c93.c
+++ b/libavcodec/c93.c
@@ -133,7 +133,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     if (newpic->data[0])
         avctx->release_buffer(avctx, newpic);
 
-    newpic->reference = 1;
+    newpic->reference = 3;
     newpic->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                          FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
     if (avctx->get_buffer(avctx, newpic)) {
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index a0ec7b8..b748f27 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -427,7 +427,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
     s->data = buf;
     s->size = buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                             FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 8f7f132..1e157ed 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -149,7 +149,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
 
     if (c->pic.data[0])
         avctx->release_buffer(avctx, &c->pic);
-    c->pic.reference = 1;
+    c->pic.reference = 3;
     c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_READABLE |
                           FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->get_buffer(avctx, &c->pic) < 0) {
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 20ec0a2..ae2f94d 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -175,7 +175,7 @@ static int cmv_decode_frame(AVCodecContext *avctx,
     FFSWAP(AVFrame, s->last_frame, s->last2_frame);
     FFSWAP(AVFrame, s->frame, s->last_frame);
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
     if (avctx->get_buffer(avctx, &s->frame)<0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index b0c42f0..ebad3b3 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -277,7 +277,7 @@ static int decode_frame(AVCodecContext *avctx,
             avctx->release_buffer(avctx, &t->last_frame);
     }
 
-    t->frame.reference = 1;
+    t->frame.reference = 3;
     if (!t->frame.data[0]) {
         if (avctx->get_buffer(avctx, &t->frame) < 0) {
             av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 26bf524..5559dc9 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -289,7 +289,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
     /* shuffle */
     FFSWAP(AVFrame, s->frame, s->last_frame);
     if (!s->frame.data[0]) {
-        s->frame.reference = 1;
+        s->frame.reference = 3;
         s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
         s->frame.linesize[0] = s->width;
 
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index fa92598..10ad270 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -160,7 +160,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
     unsigned char *pixels;
     unsigned int pixel_limit;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     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");
@@ -478,7 +478,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
     int pixel;
     unsigned int pixel_limit;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     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");
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index aad8731..d6f9a55 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -172,7 +172,7 @@ static int decode_frame(AVCodecContext *avctx,
             return -1;
         }
 
-        f->reference = 1;
+        f->reference = 3;
         f->buffer_hints = FF_BUFFER_HINTS_VALID |
                           FF_BUFFER_HINTS_PRESERVE |
                           FF_BUFFER_HINTS_REUSABLE;
@@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx,
             return -1;
         }
 
-        f->reference = 1;
+        f->reference = 3;
         f->buffer_hints = FF_BUFFER_HINTS_VALID |
                           FF_BUFFER_HINTS_PRESERVE |
                           FF_BUFFER_HINTS_REUSABLE;
@@ -243,7 +243,7 @@ static int decode_frame(AVCodecContext *avctx,
          */
         avctx->pix_fmt = PIX_FMT_YUVJ420P;
         planes = 3;
-        f->reference = 1;
+        f->reference = 3;
         f->buffer_hints = FF_BUFFER_HINTS_VALID |
                           FF_BUFFER_HINTS_PRESERVE |
                           FF_BUFFER_HINTS_REUSABLE;
@@ -288,7 +288,7 @@ static int decode_frame(AVCodecContext *avctx,
         /* Virtually the same as version 4, but is for RGB24 */
         avctx->pix_fmt = PIX_FMT_BGR24;
         planes = 3;
-        f->reference = 1;
+        f->reference = 3;
         f->buffer_hints = FF_BUFFER_HINTS_VALID |
                           FF_BUFFER_HINTS_PRESERVE |
                           FF_BUFFER_HINTS_REUSABLE;
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 31aa6f0..39fa732 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -302,7 +302,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     if ((err = extract_header(avctx, NULL)) < 0)
         return err;
-    s->frame.reference = 1;
+    s->frame.reference = 3;
 
     return 0;
 }
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index f7798e3..871a604 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -146,7 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
     AVFrame * const p= (AVFrame*)&s->picture;
     int start;
 
-    p->reference = 1;
+    p->reference = 3;
     p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, p)) {
         av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index 7ac4c01..32d9a34 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -238,7 +238,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
     if (ctx->pic.data[0])
         avctx->release_buffer(avctx, &ctx->pic);
 
-    ctx->pic.reference = 1;
+    ctx->pic.reference = 3;
     ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
     if (avctx->get_buffer(avctx, &ctx->pic) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index 1deed0b..3bdb562 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -351,7 +351,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
         return -1;
     }
 
-    ctx->buf_ptrs[ctx->cur_index].reference = 1;
+    ctx->buf_ptrs[ctx->cur_index].reference = 3;
     ctx->buf_ptrs[ctx->cur_index].pict_type = is_pframe ? AV_PICTURE_TYPE_P:AV_PICTURE_TYPE_I;
     if(ff_thread_get_buffer(avctx, &ctx->buf_ptrs[ctx->cur_index])) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index 0f30e9d..183b298 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -59,7 +59,7 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
     avctx->pix_fmt = PIX_FMT_PAL8;
 
     avcodec_get_frame_defaults(&s->frame);
-    s->frame.reference = 1;
+    s->frame.reference = 3;
 
     return 0;
 }
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index ff11528..f23a879 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -241,7 +241,7 @@ static int mp_decode_frame(AVCodecContext *avctx,
     GetBitContext gb;
     int i, count1, count2, sz;
 
-    mp->frame.reference = 1;
+    mp->frame.reference = 3;
     mp->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &mp->frame)) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index b9531f3..30159bb 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -86,7 +86,7 @@ static int msrle_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c
index 570c628..0d7e95e 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -296,7 +296,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
         av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index dd3fe67..c8688d6 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -506,7 +506,7 @@ static int decode_frame(AVCodecContext *avctx,
                 if(p->data[0])
                     avctx->release_buffer(avctx, p);
 
-                p->reference= 1;
+                p->reference= 3;
                 if(avctx->get_buffer(avctx, p) < 0){
                     av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                     goto fail;
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 43aea13..bf3e5db 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -442,7 +442,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                             FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index df4a247..4c87b3c 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -250,7 +250,7 @@ static int rpza_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index c7eafbc..04acaec 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -367,7 +367,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     if(buf_size <= 769)
         return 0;
 
-    smk->pic.reference = 1;
+    smk->pic.reference = 3;
     smk->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if(avctx->reget_buffer(avctx, &smk->pic) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 86f4282..9ae19ff 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -443,7 +443,7 @@ static int smc_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
                             FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
     if (avctx->reget_buffer(avctx, &s->frame)) {
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index ca01f9c..95d4794 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -1701,7 +1701,7 @@ static int frame_start(SnowContext *s){
         }
     }
 
-    s->current_picture.reference= 1;
+    s->current_picture.reference= 3;
     if(s->avctx->get_buffer(s->avctx, &s->current_picture) < 0){
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return -1;
diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c
index afe84b8..44ae10e 100644
--- a/libavcodec/tiertexseqv.c
+++ b/libavcodec/tiertexseqv.c
@@ -231,7 +231,7 @@ static int seqvideo_decode_frame(AVCodecContext *avctx,
 
     SeqVideoContext *seq = avctx->priv_data;
 
-    seq->frame.reference = 1;
+    seq->frame.reference = 3;
     seq->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &seq->frame)) {
         av_log(seq->avctx, AV_LOG_ERROR, "tiertexseqvideo: reget_buffer() failed\n");
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index 9c2a273..ccebef5 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -859,7 +859,7 @@ static int truemotion1_decode_frame(AVCodecContext *avctx,
     if (truemotion1_decode_header(s) == -1)
         return -1;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     s->frame.buffer_hints = FF_BUFFER_HINTS_VALID |
         FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if (avctx->reget_buffer(avctx, &s->frame) < 0) {
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 4967e29..1054a7e 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -767,7 +767,7 @@ static int decode_frame(AVCodecContext *avctx,
         av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
         return -1;
     }
-    p->reference = 1;
+    p->reference = 3;
     p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if(avctx->reget_buffer(avctx, p) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index 54c0087..39a0fa9 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -81,7 +81,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     if(c->pic.data[0])
             avctx->release_buffer(avctx, &c->pic);
 
-    c->pic.reference = 1;
+    c->pic.reference = 3;
     c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
     if(avctx->get_buffer(avctx, &c->pic) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c
index 6d41cd9..f96c6ac 100644
--- a/libavcodec/ulti.c
+++ b/libavcodec/ulti.c
@@ -225,7 +225,7 @@ static int ulti_decode_frame(AVCodecContext *avctx,
     int skip;
     int tmp;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     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");
diff --git a/libavcodec/utvideo.c b/libavcodec/utvideo.c
index 4c3b2a1..6fb384a 100644
--- a/libavcodec/utvideo.c
+++ b/libavcodec/utvideo.c
@@ -297,7 +297,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     if (c->pic.data[0])
         avctx->release_buffer(avctx, &c->pic);
 
-    c->pic.reference = 1;
+    c->pic.reference = 3;
     c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
     if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index 622ea89..956d656 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -205,7 +205,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
 
     if(c->pic.data[0])
         avctx->release_buffer(avctx, &c->pic);
-    c->pic.reference = 1;
+    c->pic.reference = 3;
     if(avctx->get_buffer(avctx, &c->pic) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return -1;
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index 63ac33d..718a9b9 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -421,7 +421,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx,
     if (buf_size < 16)
         return buf_size;
 
-    s->frame.reference = 1;
+    s->frame.reference = 3;
     if (avctx->get_buffer(avctx, &s->frame)) {
         av_log(s->avctx, AV_LOG_ERROR, "VMD Video: get_buffer() failed\n");
         return -1;
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c
index 4c9b26c..7655103 100644
--- a/libavcodec/vmnc.c
+++ b/libavcodec/vmnc.c
@@ -293,7 +293,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     const uint8_t *src = buf;
     int dx, dy, w, h, depth, enc, chunks, res, size_left;
 
-    c->pic.reference = 1;
+    c->pic.reference = 3;
     c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
     if(avctx->reget_buffer(avctx, &c->pic) < 0){
         av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index dbbbd54..cca3e20 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -529,7 +529,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         }
 
         if (!is_alpha) {
-            p->reference = 1;
+            p->reference = 3;
             if (avctx->get_buffer(avctx, p) < 0) {
                 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                 return -1;
diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index 938a558..180dcd4 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -378,7 +378,7 @@ static int xan_decode_frame(AVCodecContext *avctx,
     int ftype;
     int ret;
 
-    s->pic.reference = 1;
+    s->pic.reference = 3;
     s->pic.buffer_hints = FF_BUFFER_HINTS_VALID |
                           FF_BUFFER_HINTS_PRESERVE |
                           FF_BUFFER_HINTS_REUSABLE;
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 42da1fb..2694a4c 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -404,7 +404,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     if(c->pic.data[0])
             avctx->release_buffer(avctx, &c->pic);
 
-    c->pic.reference = 1;
+    c->pic.reference = 3;
     c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
     if(avctx->get_buffer(avctx, &c->pic) < 0){
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-- 
1.7.7.1



More information about the ffmpeg-devel mailing list