diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d696676f02..581572031f 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -8314,7 +8314,7 @@ static int decode_frame(AVCodecContext *avctx, h->got_avcC = 1; } - if(!h->is_avc && s->avctx->extradata_size && s->picture_number==0){ + if(avctx->frame_number==0 && !h->is_avc && s->avctx->extradata_size){ if(decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) < 0) return -1; }