changeset 191:efb35207fb1b libavformat

update duration and start_time
author bellard
date Fri, 08 Aug 2003 17:58:38 +0000
parents 94fa5e3367ed
children 0316a506aeb0
files mov.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Fri Aug 08 17:54:05 2003 +0000
+++ b/mov.c	Fri Aug 08 17:58:38 2003 +0000
@@ -895,7 +895,7 @@
 		       );
 #endif
 
-               st->time_length=0;//Not possible to get from this info, must count number of AMR frames
+               st->duration = AV_NOPTS_VALUE;//Not possible to get from this info, must count number of AMR frames
                st->codec.sample_rate=8000;
                st->codec.channels=1;
                st->codec.bits_per_sample=16;
@@ -1153,7 +1153,8 @@
     sc->sample_to_chunk_index = -1;
     st->priv_data = sc;
     st->codec.codec_type = CODEC_TYPE_MOV_OTHER;
-    st->time_length = (c->duration * 1000) / c->time_scale; // time in miliseconds
+    st->start_time = 0; /* XXX: check */
+    st->duration = (c->duration * (int64_t)AV_TIME_BASE) / c->time_scale;
     c->streams[c->fc->nb_streams-1] = sc;
 
     return mov_read_default(c, pb, atom);
@@ -1182,7 +1183,8 @@
     get_be32(pb); /* modification time */
     st->id = (int)get_be32(pb); /* track id (NOT 0 !)*/
     get_be32(pb); /* reserved */
-    st->time_length = get_be32(pb) * 1000 / c->time_scale; /* duration */
+    st->start_time = 0; /* check */
+    st->duration = (get_be32(pb) * (int64_t)AV_TIME_BASE) / c->time_scale; /* duration */
     get_be32(pb); /* reserved */
     get_be32(pb); /* reserved */