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/utils.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/utils.c')
-rw-r--r-- | libavcodec/utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4ef9cb24a2..b5bd17f4a9 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -442,8 +442,7 @@ void avcodec_get_context_defaults(AVCodecContext *s){ s->error_concealment= 3; s->error_resilience= 1; s->workaround_bugs= FF_BUG_AUTODETECT; - s->frame_rate_base= 1; - s->frame_rate = 25; + s->time_base= (AVRational){0,1}; s->gop_size= 50; s->me_method= ME_EPZS; s->get_buffer= avcodec_default_get_buffer; @@ -734,7 +733,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %dx%d, %0.2f fps", enc->width, enc->height, - (float)enc->frame_rate / enc->frame_rate_base); + 1/av_q2d(enc->time_base)); } if (encode) { snprintf(buf + strlen(buf), buf_size - strlen(buf), @@ -930,6 +929,12 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c){ return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); } +int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ + int64_t b= bq.num * (int64_t)cq.den; + int64_t c= cq.num * (int64_t)bq.den; + return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); +} + int64_t ff_gcd(int64_t a, int64_t b){ if(b) return ff_gcd(b, a%b); else return a; |