Mercurial > mplayer.hg
changeset 5630:dfc219577da6
FPS calculation fixed
author | arpi |
---|---|
date | Mon, 15 Apr 2002 02:48:11 +0000 |
parents | 9b422f216fb5 |
children | 6cc3c2466288 |
files | libmpdemux/demux_mov.c |
diffstat | 1 files changed, 2 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c Mon Apr 15 02:33:05 2002 +0000 +++ b/libmpdemux/demux_mov.c Mon Apr 15 02:48:11 2002 +0000 @@ -457,14 +457,6 @@ 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 && trak->type == MOV_TRAK_VIDEO) - { - sh_video_t* sh=get_sh_video(demuxer,priv->track_db); - if (sh && !sh->fps) - sh->fps = trak->timescale/trak->durmap[i].dur; - /* initial fps */ - } } if(trak->length!=pts) mp_msg(MSGT_DEMUX, MSGL_WARN, "Warning! pts=%d length=%d\n",pts,trak->length); break; @@ -876,7 +868,8 @@ // printf("pos=%d max=%d\n",pos,trak->stdata_len); } } - if(!sh->fps) sh->fps=trak->timescale; + sh->fps=trak->timescale/ + ((trak->durmap_size>=1)?(float)trak->durmap[0].dur:1); sh->frametime=1.0f/sh->fps; sh->disp_w=trak->stdata[25]|(trak->stdata[24]<<8);