summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-22 22:49:09 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-10-22 22:49:09 +0000
commit579abe4172cf33932cc5f2eb99e4db14d30bdf2b (patch)
tree33e54728f4482ffc062be021f8f91bc71f06f8c1 /libmpdemux
parenta4fd047e68d451ddcb5e2a20ca39c399c7da961b (diff)
downloadmpv-579abe4172cf33932cc5f2eb99e4db14d30bdf2b.tar.bz2
mpv-579abe4172cf33932cc5f2eb99e4db14d30bdf2b.tar.xz
compression algo detection fix (bswap) and fps fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2387 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mov.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index 34b7f35d44..8264bee274 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -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 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
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 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
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 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
} 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')){