[Ffmpeg-cvslog] CVS: ffmpeg/libavformat mov.c,1.128,1.129

Baptiste Coudurier CVS bcoudurier
Wed Mar 22 11:45:06 CET 2006


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

Modified Files:
	mov.c 
Log Message:
support 64bit date/duration

Index: mov.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/mov.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -d -r1.128 -r1.129
--- mov.c	21 Mar 2006 18:32:58 -0000	1.128
+++ mov.c	22 Mar 2006 10:45:04 -0000	1.129
@@ -693,16 +693,21 @@
 
 static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
 {
-    get_byte(pb); /* version */
+    int version = get_byte(pb); /* version */
     get_byte(pb); get_byte(pb); get_byte(pb); /* flags */
 
-    get_be32(pb); /* creation time */
-    get_be32(pb); /* modification time */
+    if (version == 1) {
+        get_be64(pb);
+        get_be64(pb);
+    } else {
+        get_be32(pb); /* creation time */
+        get_be32(pb); /* modification time */
+    }
     c->time_scale = get_be32(pb); /* time scale */
 #ifdef DEBUG
     av_log(NULL, AV_LOG_DEBUG, "time scale = %i\n", c->time_scale);
 #endif
-    c->duration = get_be32(pb); /* duration */
+    c->duration = (version == 1) ? get_be64(pb) : get_be32(pb); /* duration */
     get_be32(pb); /* preferred scale */
 
     get_be16(pb); /* preferred volume */
@@ -1335,10 +1340,11 @@
 static int mov_read_tkhd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
 {
     AVStream *st;
+    int version;
 
     st = c->fc->streams[c->fc->nb_streams-1];
 
-    get_byte(pb); /* version */
+    version = get_byte(pb); /* version */
 
     get_byte(pb); get_byte(pb);
     get_byte(pb); /* flags */
@@ -1349,12 +1355,17 @@
     MOV_TRACK_IN_POSTER 0x0008
     */
 
-    get_be32(pb); /* creation time */
-    get_be32(pb); /* modification time */
+    if (version == 1) {
+        get_be64(pb);
+        get_be64(pb);
+    } else {
+        get_be32(pb); /* creation time */
+        get_be32(pb); /* modification time */
+    }
     st->id = (int)get_be32(pb); /* track id (NOT 0 !)*/
     get_be32(pb); /* reserved */
     st->start_time = 0; /* check */
-    get_be32(pb); /* highlevel (considering edits) duration in movie timebase */
+    (version == 1) ? get_be64(pb) : get_be32(pb); /* highlevel (considering edits) duration in movie timebase */
     get_be32(pb); /* reserved */
     get_be32(pb); /* reserved */
 





More information about the ffmpeg-cvslog mailing list