summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-02 23:18:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-02 23:18:32 +0200
commit4e9e0700fb8fd89b565032e6f049b91014ec1f3c (patch)
treebc2de898ec752ead43994f06c189c33f5e8653eb /libavformat/utils.c
parent1fb07be0628b89347e0b48394fd86689f5079262 (diff)
has_decode_delay_been_guessed: skip guessing when sps.num_reorder_frames is available
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 00a8239c47..67616af661 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2285,6 +2285,11 @@ static int has_codec_parameters(AVStream *st)
static int has_decode_delay_been_guessed(AVStream *st)
{
if(st->codec->codec_id != CODEC_ID_H264) return 1;
+#if CONFIG_H264_DECODER
+ if(st->codec->has_b_frames &&
+ avpriv_h264_has_num_reorder_frames(st->codec) == st->codec->has_b_frames)
+ return 1;
+#endif
if(st->codec->has_b_frames<3)
return st->info->nb_decoded_frames >= 6;
return st->info->nb_decoded_frames >= 20;