has_decode_delay_been_guessed: skip guessing when sps.num_reorder_frames is available
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Jul 2012 21:18:32 +0000 (23:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Jul 2012 21:18:32 +0000 (23:18 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 00a8239..67616af 100644 (file)
@@ -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;