Commit d0b41d89 authored by Michael Niedermayer's avatar Michael Niedermayer

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
parent 74aa41ba
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment