changeset 4447:1fb8c4a56366 libavformat

adjust time rate according to elst time offset
author bcoudurier
date Wed, 11 Feb 2009 02:32:39 +0000
parents efe78f986bec
children 587ce9359a9b
files mov.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Wed Feb 11 01:06:12 2009 +0000
+++ b/mov.c	Wed Feb 11 02:32:39 2009 +0000
@@ -1162,8 +1162,6 @@
         return -1;
     dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
 
-    sc->time_rate=0;
-
     for(i=0; i<entries; i++) {
         int sample_duration;
         int sample_count;
@@ -1768,8 +1766,10 @@
         get_be32(pb); /* Track duration */
         time = get_be32(pb); /* Media time */
         get_be32(pb); /* Media rate */
-        if (i == 0 && time != -1)
+        if (i == 0 && time != -1) {
             sc->time_offset = time;
+            sc->time_rate = av_gcd(sc->time_rate, time);
+        }
     }
 
     if(edit_count > 1)