@ -1722,23 +1722,22 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
check_marker ( gb , " before time_increment_resolution " ) ;
s - > avctx - > time_base . den = get_bits ( gb , 16 ) ;
if ( ! s - > avctx - > time_base . den ) {
av_log ( s - > avctx , AV_LOG_ERROR , " time_base.den==0 \n " ) ;
s - > avctx - > time_base . num = 0 ;
s - > avctx - > framerate . num = get_bits ( gb , 16 ) ;
if ( ! s - > avctx - > framerate . num ) {
av_log ( s - > avctx , AV_LOG_ERROR , " framerate==0 \n " ) ;
return - 1 ;
}
ctx - > time_increment_bits = av_log2 ( s - > avctx - > time_base . den - 1 ) + 1 ;
ctx - > time_increment_bits = av_log2 ( s - > avctx - > framerate . num - 1 ) + 1 ;
if ( ctx - > time_increment_bits < 1 )
ctx - > time_increment_bits = 1 ;
check_marker ( gb , " before fixed_vop_rate " ) ;
if ( get_bits1 ( gb ) ! = 0 ) /* fixed_vop_rate */
s - > avctx - > time_base . num = get_bits ( gb , ctx - > time_increment_bits ) ;
s - > avctx - > framerate . den = get_bits ( gb , ctx - > time_increment_bits ) ;
else
s - > avctx - > time_base . num = 1 ;
s - > avctx - > framerate . den = 1 ;
ctx - > t_frame = 0 ;
@ -2126,19 +2125,19 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
if ( s - > pict_type ! = AV_PICTURE_TYPE_B ) {
s - > last_time_base = s - > time_base ;
s - > time_base + = time_incr ;
s - > time = s - > time_base * s - > avctx - > time_base . den + time_increment ;
s - > time = s - > time_base * s - > avctx - > framerate . num + time_increment ;
if ( s - > workaround_bugs & FF_BUG_UMP4 ) {
if ( s - > time < s - > last_non_b_time ) {
/* header is not mpeg-4-compatible, broken encoder,
* trying to workaround */
s - > time_base + + ;
s - > time + = s - > avctx - > time_base . den ;
s - > time + = s - > avctx - > framerate . num ;
}
}
s - > pp_time = s - > time - s - > last_non_b_time ;
s - > last_non_b_time = s - > time ;
} else {
s - > time = ( s - > last_time_base + time_incr ) * s - > avctx - > time_base . den + time_increment ;
s - > time = ( s - > last_time_base + time_incr ) * s - > avctx - > framerate . num + time_increment ;
s - > pb_time = s - > pp_time - ( s - > last_non_b_time - s - > time ) ;
if ( s - > pp_time < = s - > pb_time | |
s - > pp_time < = s - > pp_time - s - > pb_time | |