aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-11 02:32:39 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-11 02:32:39 +0000
commita5929abe7a004d4a3944c14feb45cd55d197b251 (patch)
tree172243d0f76a1d8af31d9ec134c5eeafae4222ad
parent0cfa359660ddee5a854ea95acfcb1c435b0d2bb1 (diff)
downloadffmpeg-a5929abe7a004d4a3944c14feb45cd55d197b251.tar.gz
adjust time rate according to elst time offset
Originally committed as revision 17146 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mov.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f9d9a87bcb..bc682a3be7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1162,8 +1162,6 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
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 @@ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
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)