aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-02 16:31:18 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-02 16:31:18 +0000
commitd0b41d89318a2f9232444f5ead5e59df9da3cab6 (patch)
treed39ee22bf0b2379a591717901d3a470de6da055b
parent74aa41bae4c3c57f3765633963719ea824bab410 (diff)
downloadffmpeg-d0b41d89318a2f9232444f5ead5e59df9da3cab6.tar.gz
Try to support invalid h264 that does not mark IDR with POC=0.
Fixes issue576. Originally committed as revision 15153 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h264.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 1ea90f1889..18b3ea49e7 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -7488,7 +7488,7 @@ static int decode_frame(AVCodecContext *avctx,
//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 *avctx,
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;