diff raw.c @ 743:af4e24d6310c libavformat

switch to native time bases
author michael
date Sat, 30 Apr 2005 21:43:59 +0000
parents e2687b784c3a
children a03f1f7497ad
line wrap: on
line diff
--- a/raw.c	Tue Apr 26 21:46:46 2005 +0000
+++ b/raw.c	Sat Apr 30 21:43:59 2005 +0000
@@ -63,8 +63,7 @@
             av_set_pts_info(st, 64, 1, st->codec.sample_rate);
             break;
         case CODEC_TYPE_VIDEO:
-            st->codec.frame_rate      = ap->frame_rate;
-            st->codec.frame_rate_base = ap->frame_rate_base;
+            av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
             st->codec.width = ap->width;
             st->codec.height = ap->height;
 	    st->codec.pix_fmt = ap->pix_fmt;
@@ -238,12 +237,10 @@
     /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
     if (st->codec.codec_id == CODEC_ID_MJPEG || 
         st->codec.codec_id == CODEC_ID_MPEG4) {
-        if (ap && ap->frame_rate) {
-            st->codec.frame_rate      = ap->frame_rate;
-            st->codec.frame_rate_base = ap->frame_rate_base;
+        if (ap && ap->time_base.num) {
+            av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
         } else {
-            st->codec.frame_rate      = 25;
-            st->codec.frame_rate_base = 1;
+            av_set_pts_info(st, 64, 1, 25);
         }
     }
     return 0;