[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec h264.c,1.137,1.138

Michael Niedermayer CVS michael
Mon Jun 20 01:33:11 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv13688

Modified Files:
	h264.c 
Log Message:
make decoder a little bit more tolerant to missing NAL units


Index: h264.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- h264.c	17 Jun 2005 08:24:35 -0000	1.137
+++ h264.c	19 Jun 2005 23:33:09 -0000	1.138
@@ -3894,8 +3894,10 @@
         switch(mmco[i].opcode){
         case MMCO_SHORT2UNUSED:
             pic= remove_short(h, mmco[i].short_frame_num);
-            if(pic==NULL) return -1;
-            unreference_pic(h, pic);
+            if(pic)
+                unreference_pic(h, pic);
+            else if(s->avctx->debug&FF_DEBUG_MMCO)
+                av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: remove_short() failure\n");
             break;
         case MMCO_SHORT2LONG:
             pic= remove_long(h, mmco[i].long_index);
@@ -3907,8 +3909,10 @@
             break;
         case MMCO_LONG2UNUSED:
             pic= remove_long(h, mmco[i].long_index);
-            if(pic==NULL) return -1;
-            unreference_pic(h, pic);
+            if(pic)
+                unreference_pic(h, pic);
+            else if(s->avctx->debug&FF_DEBUG_MMCO)
+                av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: remove_long() failure\n");
             break;
         case MMCO_LONG:
             pic= remove_long(h, mmco[i].long_index);
@@ -4297,7 +4301,8 @@
         fill_default_ref_list(h);
     }
 
-    decode_ref_pic_list_reordering(h);
+    if(decode_ref_pic_list_reordering(h) < 0)
+        return -1;
 
     if(   (h->pps.weighted_pred          && (h->slice_type == P_TYPE || h->slice_type == SP_TYPE )) 
        || (h->pps.weighted_bipred_idc==1 && h->slice_type==B_TYPE ) )
@@ -7166,6 +7171,7 @@
     }
 #endif
     h->slice_num = 0;
+    s->current_picture_ptr= NULL;
     for(;;){
         int consumed;
         int dst_length;





More information about the ffmpeg-cvslog mailing list