Ticket #88: h264-detect-no-b-v1.patch

File h264-detect-no-b-v1.patch, 1.0 KB (added by mjs973, 5 years ago)

Detect additional "no B" h264 bitstreams

  • libavcodec/h264.c

    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 b static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ 
    30513051            ff_h264_decode_seq_parameter_set(h); 
    30523052 
    30533053            if(s->flags& CODEC_FLAG_LOW_DELAY || 
     3054              (h->sps.constraint_set_flags & 0x01) || 
    30543055              (h->sps.bitstream_restriction_flag && !h->sps.num_reorder_frames)) 
    30553056                s->low_delay=1; 
    30563057