aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-02 22:59:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-02 22:59:42 +0200
commit2c883c6acf033fe045dd3c90e997ab64001ef47a (patch)
tree8295a34c5426766489292c319aa0391a359abb86 /libavformat/utils.c
parent41dd30068acebfb938816af1d2a8ab6eb57ef9e1 (diff)
downloadffmpeg-2c883c6acf033fe045dd3c90e997ab64001ef47a.tar.gz
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 <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c6
1 files 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 */