comparison h264.c @ 11076:4a95670ed5f1 libavcodec

Fix large timebases. Fixed issue1633
author michael
date Thu, 04 Feb 2010 15:30:37 +0000
parents ec682347e19e
children 7e5d7873fad9
comparison
equal deleted inserted replaced
11075:2663fdcdb769 11076:4a95670ed5f1
1779 s->avctx->colorspace = h->sps.colorspace; 1779 s->avctx->colorspace = h->sps.colorspace;
1780 } 1780 }
1781 } 1781 }
1782 1782
1783 if(h->sps.timing_info_present_flag){ 1783 if(h->sps.timing_info_present_flag){
1784 s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale}; 1784 int64_t den= h->sps.time_scale;
1785 if(h->x264_build > 0 && h->x264_build < 44) 1785 if(h->x264_build > 0 && h->x264_build < 44)
1786 s->avctx->time_base.den *= 2; 1786 den *= 2;
1787 av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den, 1787 av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
1788 s->avctx->time_base.num, s->avctx->time_base.den, 1<<30); 1788 h->sps.num_units_in_tick, den, 1<<30);
1789 } 1789 }
1790 s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts); 1790 s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts);
1791 s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt); 1791 s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt);
1792 1792
1793 if (MPV_common_init(s) < 0) 1793 if (MPV_common_init(s) < 0)