diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-04-30 21:43:59 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-04-30 21:43:59 +0000 |
commit | c0df9d75bd9a3170a793eb1651354076360998e8 (patch) | |
tree | 0f4c75f07fc395d168bf0a7fcd92d6f9d9e9281b /libavcodec/mpeg12.c | |
parent | b7782b47c95c26d674df134973d1403e80fe9767 (diff) | |
download | ffmpeg-c0df9d75bd9a3170a793eb1651354076360998e8.tar.gz |
switch to native time bases
Originally committed as revision 4168 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index b06fe51b87..47c7887424 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -201,8 +201,8 @@ static int find_frame_rate_index(MpegEncContext *s){ int64_t d; for(i=1;i<14;i++) { - int64_t n0= 1001LL/frame_rate_tab[i].den*frame_rate_tab[i].num*s->avctx->frame_rate_base; - int64_t n1= 1001LL*s->avctx->frame_rate; + int64_t n0= 1001LL/frame_rate_tab[i].den*frame_rate_tab[i].num*s->avctx->time_base.num; + int64_t n1= 1001LL*s->avctx->time_base.den; if(s->avctx->strict_std_compliance >= 0 && i>=9) break; d = ABS(n0 - n1); @@ -226,10 +226,10 @@ static int encode_init(AVCodecContext *avctx) if(find_frame_rate_index(s) < 0){ if(s->strict_std_compliance >=0){ - av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n", avctx->frame_rate, avctx->frame_rate_base); + av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n", avctx->time_base.den, avctx->time_base.num); return -1; }else{ - av_log(avctx, AV_LOG_INFO, "MPEG1/2 does not support %d/%d fps, there may be AV sync issues\n", avctx->frame_rate, avctx->frame_rate_base); + av_log(avctx, AV_LOG_INFO, "MPEG1/2 does not support %d/%d fps, there may be AV sync issues\n", avctx->time_base.den, avctx->time_base.num); } } @@ -2099,8 +2099,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){ if(avctx->sub_id==1){//s->codec_id==avctx->codec_id==CODEC_ID //mpeg1 fps - avctx->frame_rate = frame_rate_tab[s->frame_rate_index].num; - avctx->frame_rate_base= frame_rate_tab[s->frame_rate_index].den; + avctx->time_base.den = frame_rate_tab[s->frame_rate_index].num; + avctx->time_base.num= frame_rate_tab[s->frame_rate_index].den; //mpeg1 aspect avctx->sample_aspect_ratio= av_d2q( 1.0/mpeg1_aspect[s->aspect_ratio_info], 255); @@ -2108,8 +2108,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){ }else{//mpeg2 //mpeg2 fps av_reduce( - &s->avctx->frame_rate, - &s->avctx->frame_rate_base, + &s->avctx->time_base.den, + &s->avctx->time_base.num, frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num, frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den, 1<<30); |