Mercurial > mplayer.hg
changeset 19343:24f2f73f03ca
Support for version 1 (64 bit) mvhd and mdhd, taken from libavformat mov demuxer
author | reimar |
---|---|
date | Sun, 06 Aug 2006 19:26:17 +0000 |
parents | 4e68a3881201 |
children | a5d880afbad2 |
files | libmpdemux/demux_mov.c |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c Sun Aug 06 18:55:34 2006 +0000 +++ b/libmpdemux/demux_mov.c Sun Aug 06 19:26:17 2006 +0000 @@ -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'): {