changeset 2484:a3188eb4266c libavcodec

correct long term picture management patch by (Loic <lll+ffmpeg m4x org>) fixes decoding of MR2_MW_A.264
author michael
date Tue, 01 Feb 2005 11:12:53 +0000
parents 4eb9d61cad4e
children 2844b8cf4e11
files h264.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Tue Feb 01 10:03:55 2005 +0000
+++ b/h264.c	Tue Feb 01 11:12:53 2005 +0000
@@ -3150,10 +3150,12 @@
             break; \
         }
 
-    for(i=0; i<h->long_ref_count; i++){
-        h->long_ref[i]->reference=0;
-        CHECK_DELAY(h->long_ref[i]);
-        h->long_ref[i]= NULL;
+    for(i=0; i<16; i++){
+        if (h->long_ref[i] != NULL) {
+            h->long_ref[i]->reference=0;
+            CHECK_DELAY(h->long_ref[i]);
+            h->long_ref[i]= NULL;
+        }
     }
     h->long_ref_count=0;
 
@@ -3263,6 +3265,7 @@
             
             h->long_ref[ mmco[i].long_index ]= remove_short(h, mmco[i].short_frame_num);
             h->long_ref[ mmco[i].long_index ]->long_ref=1;
+            h->long_ref_count++;
             break;
         case MMCO_LONG2UNUSED:
             pic= remove_long(h, mmco[i].long_index);