Fixes bitrate detection in CBR mpeg2 Fixes ticket3678
Unified · Split
| @@ -145,8 +145,9 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, · 144 unmodified lines | ||
| 145 | 145 | the_end: ; |
| 146 | 146 | if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) { |
| 147 | 147 | avctx->rc_max_rate = 400*bit_rate; |
| 148 | − } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate && | |
| 149 | − (bit_rate != 0x3FFFF || vbv_delay != 0xFFFF)) { | |
| 148 | + } | |
| 149 | + if (bit_rate && | |
| 150 | + ((avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate != 0x3FFFF) || vbv_delay != 0xFFFF)) { | |
| 150 | 151 | avctx->bit_rate = 400*bit_rate; |
| 151 | 152 | } |
| 152 | 153 | } |