summaryrefslogtreecommitdiffstats
path: root/libmpdemux/video.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-02 10:25:48 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-02 10:25:48 +0000
commit1a015fd22a80b9b0acdffd8395fa8c323a2d5622 (patch)
tree89c6596655ff1a6b20864066ee6dd32e5a5775b2 /libmpdemux/video.c
parent1be119decc5d477e77b4cbb770516f37c58389c7 (diff)
downloadmpv-1a015fd22a80b9b0acdffd8395fa8c323a2d5622.tar.bz2
mpv-1a015fd22a80b9b0acdffd8395fa8c323a2d5622.tar.xz
Fix frame_time for variable fps movies as it was the last frame duration.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5931 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/video.c')
-rw-r--r--libmpdemux/video.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libmpdemux/video.c b/libmpdemux/video.c
index fb62b77965..3afe5a7058 100644
--- a/libmpdemux/video.c
+++ b/libmpdemux/video.c
@@ -291,14 +291,18 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char**
case DEMUXER_TYPE_FILM:
case DEMUXER_TYPE_VIVO:
case DEMUXER_TYPE_ASF: {
- float d=d_video->pts-pts1;
- if(d>0 && d<5) frame_time=d;
+ float next_pts = ds_get_next_pts(d_video);
+ float d= next_pts > 0 ? next_pts - d_video->pts : d_video->pts-pts1;
if(d>0){
if(verbose)
if((int)sh_video->fps==1000)
mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\navg. framerate: %d fps \n",(int)(1.0f/d));
sh_video->frametime=d; // 1ms
sh_video->fps=1.0f/d;
+ frame_time = d;
+ } else {
+ mp_msg(MSGT_CPLAYER,MSGL_WARN,"\nInvalid frame duration value. Defaulting to 1/25 sec.\n");
+ frame_time = 1/25.0;
}
}
}