1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-17 12:25:03 +00:00

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19349 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2006-08-06 19:26:17 +00:00
parent 1de0c3327d
commit a6bc70e3cb

View File

@ -582,9 +582,13 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
} 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 @@ static int lschunks_intrak(demuxer_t* demuxer, int level, unsigned int id,
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'): {