[MPlayer-cvslog] r19349 - trunk/libmpdemux/demux_mov.c

reimar subversion at mplayerhq.hu
Sun Aug 6 21:26:17 CEST 2006


Author: reimar
Date: Sun Aug  6 21:26:17 2006
New Revision: 19349

Modified:
   trunk/libmpdemux/demux_mov.c

Log:
Support for version 1 (64 bit) mvhd and mdhd, taken from libavformat mov demuxer


Modified: trunk/libmpdemux/demux_mov.c
==============================================================================
--- trunk/libmpdemux/demux_mov.c	(original)
+++ trunk/libmpdemux/demux_mov.c	Sun Aug  6 21:26:17 2006
@@ -582,9 +582,13 @@
 	} else { /* not in track */
 	  switch(id) {
 	    case MOV_FOURCC('m','v','h','d'): {
-		stream_skip(demuxer->stream,12);
+		int version = stream_read_char(demuxer->stream);
+		stream_skip(demuxer->stream, (version == 1) ? 19 : 11);
 		priv->timescale=stream_read_dword(demuxer->stream);
-		priv->duration=stream_read_dword(demuxer->stream);
+		if (version == 1)
+		    priv->duration=stream_read_qword(demuxer->stream);
+		else
+		    priv->duration=stream_read_dword(demuxer->stream);
 		mp_msg(MSGT_DEMUX, MSGL_V,"MOV: %*sMovie header (%d bytes): tscale=%d  dur=%d\n",level,"",(int)len,
 		    (int)priv->timescale,(int)priv->duration);
 		break;
@@ -1580,12 +1584,16 @@
       break;
     }
     case MOV_FOURCC('m','d','h','d'): {
+      int version = stream_read_char(demuxer->stream);
       mp_msg(MSGT_DEMUX, MSGL_V, "MOV: %*sMedia header!\n", level, "");
-      stream_skip(demuxer->stream, 12);
+      stream_skip(demuxer->stream, (version == 1) ? 19 : 11);
       // read timescale
       trak->timescale = stream_read_dword(demuxer->stream);
       // read length
-      trak->length = stream_read_dword(demuxer->stream);
+      if (version == 1)
+          trak->length = stream_read_qword(demuxer->stream);
+      else
+          trak->length = stream_read_dword(demuxer->stream);
       break;
     }
     case MOV_FOURCC('h','d','l','r'): {



More information about the MPlayer-cvslog mailing list