Ticket #1862: 0001-Wrong-bit-rate-in-MPEG2-video-file-Ticket-1862.patch

File 0001-Wrong-bit-rate-in-MPEG2-video-file-Ticket-1862.patch, 1.3 KB (added by Heesuk Jung, 4 years ago)

Resolving Patch

  • libavcodec/mpegvideo_parser.c

    From 541c50e4f4bf935733e1772754424b9d83953983 Mon Sep 17 00:00:00 2001
    From: Heesuk Jung <heesuk.jung@lge.com>
    Date: Mon, 29 Oct 2012 05:56:20 -0700
    Subject: [PATCH] Wrong bit rate in MPEG2 video file (Ticket #1862)
    
    mpegvideo parser sometime get wrong stream bit rate which is 0x3FFFF*400.
    But maximum bit rate of MPEG2 video is up to 80 Mbps in case 1920x1080 resolution.
    When bit rate is 0x3FFFF*400, set bit rate zero.
    
    * Problematic link
    https://docs.google.com/open?id=0B6r7ZfWFIypCUkhPa0dyTGdFSE0
    ---
     libavcodec/mpegvideo_parser.c |    3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
    index c60d3cd..ff440fe 100644
    a b static void mpegvideo_extract_headers(AVCodecParserContext *s, 
    6868                pc->frame_rate.den = avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_index].num; 
    6969                pc->frame_rate.num = avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_index].den; 
    7070                avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400; 
     71                if (avctx->bit_rate == 0x3FFFF*400) { 
     72                    avctx->bit_rate = 0; 
     73                } 
    7174                avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO; 
    7275            } 
    7376            break;