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

michael subversion
Tue Sep 2 18:31:19 CEST 2008


Author: michael
Date: Tue Sep  2 18:31:18 2008
New Revision: 15153

Log:
Try to support invalid h264 that does not mark IDR with POC=0.
Fixes issue576.


Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Tue Sep  2 18:31:18 2008
@@ -7488,7 +7488,7 @@ static int decode_frame(AVCodecContext *
 //FIXME factorize this with the output code below
         out = h->delayed_pic[0];
         out_idx = 0;
-        for(i=1; h->delayed_pic[i] && h->delayed_pic[i]->poc; i++)
+        for(i=1; h->delayed_pic[i] && (h->delayed_pic[i]->poc && !h->delayed_pic[i]->key_frame); i++)
             if(h->delayed_pic[i]->poc < out->poc){
                 out = h->delayed_pic[i];
                 out_idx = i;
@@ -7632,12 +7632,12 @@ static int decode_frame(AVCodecContext *
 
             out = h->delayed_pic[0];
             out_idx = 0;
-            for(i=1; h->delayed_pic[i] && h->delayed_pic[i]->poc; i++)
+            for(i=1; h->delayed_pic[i] && (h->delayed_pic[i]->poc && !h->delayed_pic[i]->key_frame); i++)
                 if(h->delayed_pic[i]->poc < out->poc){
                     out = h->delayed_pic[i];
                     out_idx = i;
                 }
-            cross_idr = !h->delayed_pic[0]->poc || !!h->delayed_pic[i];
+            cross_idr = !h->delayed_pic[0]->poc || !!h->delayed_pic[i] || h->delayed_pic[0]->key_frame;
 
             out_of_order = !cross_idr && out->poc < h->outputed_poc;
 




More information about the ffmpeg-cvslog mailing list