[FFmpeg-cvslog] r11218 - trunk/libavcodec/h264.c

heydowns subversion
Fri Dec 14 23:49:30 CET 2007


Author: heydowns
Date: Fri Dec 14 23:49:30 2007
New Revision: 11218

Log:
Fix brain-dead parts of r11216, specifically:
Actually unreference removed pics
And check for too many reference frames as originally intended, not equal
to max reference frames.


Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Fri Dec 14 23:49:30 2007
@@ -3612,8 +3612,7 @@ static int execute_ref_pic_marking(H264C
         s->current_picture_ptr->reference |= s->picture_structure;
     }
 
-    if (h->sps.ref_frame_count &&
-            h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count){
+    if (h->long_ref_count + h->short_ref_count > h->sps.ref_frame_count){
 
         /* We have too many reference frames, probably due to corrupted
          * stream. Need to discard one frame. Prevents overrun of the
@@ -3629,10 +3628,13 @@ static int execute_ref_pic_marking(H264C
                     break;
 
             assert(i < 16);
+            pic = h->long_ref[i];
             remove_long_at_index(h, i);
         } else {
+            pic = h->short_ref[h->short_ref_count - 1];
             remove_short_at_index(h, h->short_ref_count - 1);
         }
+        unreference_pic(h, pic, 0);
     }
 
     print_short_term(h);




More information about the ffmpeg-cvslog mailing list