diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c index ef9ea923f6..de92f1b1dc 100644 --- a/libavcodec/mpeg4video_parser.c +++ b/libavcodec/mpeg4video_parser.c @@ -99,6 +99,7 @@ static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx, init_get_bits(gb, buf, 8 * buf_size); ret = ff_mpeg4_parse_picture_header(dec_ctx, gb, 0, 1); + avctx->has_b_frames = !s->low_delay; if (s->width && (!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height)) { ret = ff_set_dimensions(avctx, s->width, s->height); diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 8bdc82b9a9..d5979096ae 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3676,7 +3676,6 @@ int ff_mpeg4_parse_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, end: if (s->avctx->flags & AV_CODEC_FLAG_LOW_DELAY) s->low_delay = 1; - s->avctx->has_b_frames = !s->low_delay; if (s->studio_profile) { if (!s->avctx->bits_per_raw_sample) {