From 2c883c6acf033fe045dd3c90e997ab64001ef47a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 2 Jul 2012 22:59:42 +0200 Subject: [PATCH] has_decode_delay_been_guessed: improve heuristic This allows MR4_TANDBERG_C.264 and MR5_TANDBERG_C.264 to be decoded without -strict 1 Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 27804b8585..00a8239c47 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2284,8 +2284,10 @@ static int has_codec_parameters(AVStream *st) static int has_decode_delay_been_guessed(AVStream *st) { - return st->codec->codec_id != CODEC_ID_H264 || - st->info->nb_decoded_frames >= 6; + if(st->codec->codec_id != CODEC_ID_H264) return 1; + if(st->codec->has_b_frames<3) + return st->info->nb_decoded_frames >= 6; + return st->info->nb_decoded_frames >= 20; } /* returns 1 or 0 if or if not decoded data was returned, or a negative error */