[FFmpeg-cvslog] has_decode_delay_been_guessed: improve heuristic
Michael Niedermayer
git at videolan.org
Mon Jul 2 23:22:27 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jul 2 22:59:42 2012 +0200| [2c883c6acf033fe045dd3c90e997ab64001ef47a] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c883c6acf033fe045dd3c90e997ab64001ef47a
---
libavformat/utils.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 27804b8..00a8239 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 */
More information about the ffmpeg-cvslog
mailing list