comparison libmpdemux/demux_mov.c @ 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 f399b52a985a
children 2e3981fa938c
comparison
equal deleted inserted replaced
19342:4e68a3881201 19343:24f2f73f03ca
580 if (lschunks_intrak(demuxer, level, id, pos, len, trak) < 0) 580 if (lschunks_intrak(demuxer, level, id, pos, len, trak) < 0)
581 return; 581 return;
582 } else { /* not in track */ 582 } else { /* not in track */
583 switch(id) { 583 switch(id) {
584 case MOV_FOURCC('m','v','h','d'): { 584 case MOV_FOURCC('m','v','h','d'): {
585 stream_skip(demuxer->stream,12); 585 int version = stream_read_char(demuxer->stream);
586 stream_skip(demuxer->stream, (version == 1) ? 19 : 11);
586 priv->timescale=stream_read_dword(demuxer->stream); 587 priv->timescale=stream_read_dword(demuxer->stream);
587 priv->duration=stream_read_dword(demuxer->stream); 588 if (version == 1)
589 priv->duration=stream_read_qword(demuxer->stream);
590 else
591 priv->duration=stream_read_dword(demuxer->stream);
588 mp_msg(MSGT_DEMUX, MSGL_V,"MOV: %*sMovie header (%d bytes): tscale=%d dur=%d\n",level,"",(int)len, 592 mp_msg(MSGT_DEMUX, MSGL_V,"MOV: %*sMovie header (%d bytes): tscale=%d dur=%d\n",level,"",(int)len,
589 (int)priv->timescale,(int)priv->duration); 593 (int)priv->timescale,(int)priv->duration);
590 break; 594 break;
591 } 595 }
592 case MOV_FOURCC('t','r','a','k'): { 596 case MOV_FOURCC('t','r','a','k'): {
1578 char2short(trak->tkdata, 32), // layer 1582 char2short(trak->tkdata, 32), // layer
1579 char2short(trak->tkdata, 36)); // volume 1583 char2short(trak->tkdata, 36)); // volume
1580 break; 1584 break;
1581 } 1585 }
1582 case MOV_FOURCC('m','d','h','d'): { 1586 case MOV_FOURCC('m','d','h','d'): {
1587 int version = stream_read_char(demuxer->stream);
1583 mp_msg(MSGT_DEMUX, MSGL_V, "MOV: %*sMedia header!\n", level, ""); 1588 mp_msg(MSGT_DEMUX, MSGL_V, "MOV: %*sMedia header!\n", level, "");
1584 stream_skip(demuxer->stream, 12); 1589 stream_skip(demuxer->stream, (version == 1) ? 19 : 11);
1585 // read timescale 1590 // read timescale
1586 trak->timescale = stream_read_dword(demuxer->stream); 1591 trak->timescale = stream_read_dword(demuxer->stream);
1587 // read length 1592 // read length
1588 trak->length = stream_read_dword(demuxer->stream); 1593 if (version == 1)
1594 trak->length = stream_read_qword(demuxer->stream);
1595 else
1596 trak->length = stream_read_dword(demuxer->stream);
1589 break; 1597 break;
1590 } 1598 }
1591 case MOV_FOURCC('h','d','l','r'): { 1599 case MOV_FOURCC('h','d','l','r'): {
1592 unsigned int tmp = stream_read_dword(demuxer->stream); 1600 unsigned int tmp = stream_read_dword(demuxer->stream);
1593 unsigned int type = stream_read_dword_le(demuxer->stream); 1601 unsigned int type = stream_read_dword_le(demuxer->stream);