summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_parser.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-20 20:01:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-25 14:15:43 +0200
commitd647ef0c8069876e53f9ce630890f1fb09986247 (patch)
tree4fea57c0adf85a7cc10ec41a1b435e779998a0cf /libavcodec/mpegvideo_parser.c
parent08a110ca871e82630d5f6f834922014cd375f524 (diff)
avcodec/mpegvideo_parser: consider vbv_delay in bitrate heuristic also for mpeg2
Fixes bitrate detection in CBR mpeg2 Fixes ticket3678
Diffstat (limited to 'libavcodec/mpegvideo_parser.c')
-rw-r--r--libavcodec/mpegvideo_parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index 7aa3660f7f..44bf26d31f 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -145,8 +145,9 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
the_end: ;
if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) {
avctx->rc_max_rate = 400*bit_rate;
- } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate &&
- (bit_rate != 0x3FFFF || vbv_delay != 0xFFFF)) {
+ }
+ if (bit_rate &&
+ ((avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate != 0x3FFFF) || vbv_delay != 0xFFFF)) {
avctx->bit_rate = 400*bit_rate;
}
}