[Ffmpeg-cvslog] CVS: ffmpeg/libavformat mov.c,1.121,1.122

Michael Niedermayer CVS michael
Sat Mar 11 12:30:10 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv16968

Modified Files:
	mov.c 
Log Message:
some mov files have invalid pts so we need to consider these pts too in calculating the timabase


Index: mov.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/mov.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- mov.c	6 Mar 2006 22:15:43 -0000	1.121
+++ mov.c	11 Mar 2006 11:30:07 -0000	1.122
@@ -1258,6 +1258,8 @@
 
 static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
 {
+    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
+    MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;
     unsigned int i, entries;
 
     get_byte(pb); /* version */
@@ -1266,14 +1268,19 @@
     if(entries >= UINT_MAX / sizeof(Time2Sample))
         return -1;
 
-    c->streams[c->fc->nb_streams-1]->ctts_count = entries;
-    c->streams[c->fc->nb_streams-1]->ctts_data = av_malloc(entries * sizeof(Time2Sample));
+    sc->ctts_count = entries;
+    sc->ctts_data = av_malloc(entries * sizeof(Time2Sample));
 
     dprintf("track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     for(i=0; i<entries; i++) {
-        c->streams[c->fc->nb_streams - 1]->ctts_data[i].count= get_be32(pb);
-        c->streams[c->fc->nb_streams - 1]->ctts_data[i].duration= get_be32(pb);
+        int count    =get_be32(pb);
+        int duration =get_be32(pb);
+
+        sc->ctts_data[i].count   = count;
+        sc->ctts_data[i].duration= duration;
+
+        sc->time_rate= ff_gcd(sc->time_rate, duration);
     }
     return 0;
 }





More information about the ffmpeg-cvslog mailing list