diff utils.c @ 2637:ef44d24680d1 libavcodec

switch to native time bases
author michael
date Sat, 30 Apr 2005 21:43:59 +0000
parents 2344c6713011
children 659b92488061
line wrap: on
line diff
--- a/utils.c	Mon Apr 25 18:41:38 2005 +0000
+++ b/utils.c	Sat Apr 30 21:43:59 2005 +0000
@@ -442,8 +442,7 @@
     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 @@
             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 @@
     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;