diff rm.c @ 743:af4e24d6310c libavformat

switch to native time bases
author michael
date Sat, 30 Apr 2005 21:43:59 +0000
parents 82c34355e466
children c5077fdab490
line wrap: on
line diff
--- a/rm.c	Tue Apr 26 21:46:46 2005 +0000
+++ b/rm.c	Sat Apr 30 21:43:59 2005 +0000
@@ -316,7 +316,7 @@
             break;
         case CODEC_TYPE_VIDEO:
             rm->video_stream = stream;
-            stream->frame_rate = (float)codec->frame_rate / (float)codec->frame_rate_base;
+            stream->frame_rate = (float)codec->time_base.den / (float)codec->time_base.num;
             /* XXX: dummy values */
             stream->packet_max_size = 4096;
             stream->nb_packets = 0;
@@ -641,8 +641,8 @@
             start_time = get_be32(pb); /* start time */
             get_be32(pb); /* preroll */
             duration = get_be32(pb); /* duration */
-            st->start_time = start_time * (AV_TIME_BASE / 1000);
-            st->duration = duration * (AV_TIME_BASE / 1000);
+            st->start_time = start_time;
+            st->duration = duration;
             get_str8(pb, buf, sizeof(buf)); /* desc */
             get_str8(pb, buf, sizeof(buf)); /* mimetype */
             codec_data_size = get_be32(pb);
@@ -670,7 +670,7 @@
                     goto fail1;
                 st->codec.width = get_be16(pb);
                 st->codec.height = get_be16(pb);
-                st->codec.frame_rate_base= 1;
+                st->codec.time_base.num= 1;
                 fps= get_be16(pb);
                 st->codec.codec_type = CODEC_TYPE_VIDEO;
                 get_be32(pb);
@@ -682,7 +682,7 @@
                 get_buffer(pb, st->codec.extradata, st->codec.extradata_size);
                 
 //                av_log(NULL, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2);
-                st->codec.frame_rate = fps * st->codec.frame_rate_base;
+                st->codec.time_base.den = fps * st->codec.time_base.num;
                 /* modification of h263 codec version (!) */
 #ifdef WORDS_BIGENDIAN
                 h263_hack_version = ((uint32_t*)st->codec.extradata)[1];