[Mplayer-cvslog] CVS: main/libmpdemux demux_mov.c,1.11,1.12
Alex Beregszaszi
alex at mplayer.dev.hu
Tue Oct 23 00:49:12 CEST 2001
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv5449
Modified Files:
demux_mov.c
Log Message:
compression algo detection fix (bswap) and fps fix
Index: demux_mov.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mov.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- demux_mov.c 21 Oct 2001 15:47:31 -0000 1.11
+++ demux_mov.c 22 Oct 2001 22:49:09 -0000 1.12
@@ -1,6 +1,7 @@
// QuickTime MOV file parser by A'rpi
// based on TOOLS/movinfo.c by me & Al3x
// compressed header support from moov.c of the openquicktime lib.
+// References: http://openquicktime.sf.net/, http://www.heroinewarrior.com/
#include <stdio.h>
#include <stdlib.h>
@@ -20,6 +21,8 @@
#include "demuxer.h"
#include "stheader.h"
+#include "bswap.h"
+
#ifdef HAVE_ZLIB
#include <zlib.h>
#endif
@@ -298,6 +301,14 @@
trak->durmap[i].num=stream_read_dword(demuxer->stream);
trak->durmap[i].dur=stream_read_dword(demuxer->stream);
pts+=trak->durmap[i].num*trak->durmap[i].dur;
+
+ if(i==0)
+ {
+ sh_video_t* sh=new_sh_video(demuxer,priv->track_db);
+ if (!sh->fps)
+ sh->fps = trak->timescale/trak->durmap[i].dur;
+ /* initial fps */
+ }
}
if(trak->length!=pts) printf("Warning! pts=%d length=%d\n",pts,trak->length);
break;
@@ -401,7 +412,7 @@
case MOV_TRAK_VIDEO: {
sh_video_t* sh=new_sh_video(demuxer,priv->track_db);
sh->format=trak->fourcc;
- sh->fps=trak->timescale;
+ if(!sh->fps) sh->fps=trak->timescale;
sh->frametime=1.0f/sh->fps;
sh->disp_w=trak->tkdata[77]|(trak->tkdata[76]<<8);
sh->disp_h=trak->tkdata[81]|(trak->tkdata[80]<<8);
@@ -444,7 +455,7 @@
} else
if(id==MOV_FOURCC('d','c','o','m')){
// int temp=stream_read_dword(demuxer->stream);
- unsigned int len=stream_read_dword(demuxer->stream);
+ unsigned int len=bswap_32(stream_read_dword(demuxer->stream));
printf("Compressed header uses %.4s algo!\n",&len);
} else
if(id==MOV_FOURCC('c','m','v','d')){
More information about the MPlayer-cvslog
mailing list