From c8ecc9954893a5e156c5972ee8e14c0a0c358b37 Mon Sep 17 00:00:00 2001
From: Mike Scheutzow <mjs973@optonline.net>
Date: Sat, 7 May 2011 11:43:31 -0400
Subject: [PATCH] Improved detection of h264 bitstream with no B frames

The sps.constraint_set0_flag indicates that the bitstream is baseline profile,
which means the stream has no B-pictures.  This patch fixes trac0088.


Signed-off-by: Mike Scheutzow <mjs973@optonline.net>
---
 libavcodec/h264.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 353a0b3..e7c33ed 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3051,6 +3051,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
             ff_h264_decode_seq_parameter_set(h);
 
             if(s->flags& CODEC_FLAG_LOW_DELAY ||
+              (h->sps.constraint_set_flags & 0x01) ||
               (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames))
                 s->low_delay=1;
 
-- 
1.7.3.5

