[FFmpeg-cvslog] r21636 - in trunk/libavcodec: h264.c h264_ps.c
michael
subversion
Thu Feb 4 16:30:37 CET 2010
Author: michael
Date: Thu Feb 4 16:30:37 2010
New Revision: 21636
Log:
Fix large timebases.
Fixed issue1633
Modified:
trunk/libavcodec/h264.c
trunk/libavcodec/h264_ps.c
Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c Thu Feb 4 15:26:57 2010 (r21635)
+++ trunk/libavcodec/h264.c Thu Feb 4 16:30:37 2010 (r21636)
@@ -1781,11 +1781,11 @@ static int decode_slice_header(H264Conte
}
if(h->sps.timing_info_present_flag){
- s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale};
+ int64_t den= h->sps.time_scale;
if(h->x264_build > 0 && h->x264_build < 44)
- s->avctx->time_base.den *= 2;
+ den *= 2;
av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
- s->avctx->time_base.num, s->avctx->time_base.den, 1<<30);
+ h->sps.num_units_in_tick, den, 1<<30);
}
s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts);
s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt);
Modified: trunk/libavcodec/h264_ps.c
==============================================================================
--- trunk/libavcodec/h264_ps.c Thu Feb 4 15:26:57 2010 (r21635)
+++ trunk/libavcodec/h264_ps.c Thu Feb 4 16:30:37 2010 (r21636)
@@ -176,7 +176,7 @@ static inline int decode_vui_parameters(
if(sps->timing_info_present_flag){
sps->num_units_in_tick = get_bits_long(&s->gb, 32);
sps->time_scale = get_bits_long(&s->gb, 32);
- if(sps->num_units_in_tick-1 > 0x7FFFFFFEU || sps->time_scale-1 > 0x7FFFFFFEU){
+ if(!sps->num_units_in_tick || !sps->time_scale){
av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick);
return -1;
}
More information about the ffmpeg-cvslog
mailing list