[FFmpeg-devel] [PATCH 2/2] Wrong bit rate in MPEG2 video file (Ticket #1862)
Carl Eugen Hoyos
cehoyos at ag.or.at
Mon Oct 29 11:31:39 CET 2012
Heesuk Jung <heesuk.jung <at> lge.com> writes:
> - avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) |
> (buf[6]>>6))*400;
>
> + if (((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6)) == 0x3FFFF)
> {
>
> + avctx->bit_rate = 0;
>
> + } else {
>
> + avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) |
> (buf[6]>>6))*400;
>
> + }
The patch is unfortunately broken, your mailer ate it.
Wouldn't just adding two lines look simpler?
avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400;
+ if (avctx->bit_rate = 0x3FFFF)
+ avctx->bit_rate = 0;
avctx->codec_id = AV_CODEC_ID_MPEG1VIDEO;
Carl Eugen
PS: Is there also a [PATCH 1/2] ?
More information about the ffmpeg-devel
mailing list