diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-12 10:48:21 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-12 10:48:21 +0000 |
commit | 072e6fb702a5d787d14ca54a4a022737767d53f0 (patch) | |
tree | a9e2d94785d18e0ea5428c3c4bb99588fc1c616c /libmpdemux | |
parent | e40b5a0509ebee9406e4651c99f3c7f89bd89ac8 (diff) | |
download | mpv-072e6fb702a5d787d14ca54a4a022737767d53f0.tar.bz2 mpv-072e6fb702a5d787d14ca54a4a022737767d53f0.tar.xz |
generalized the cut'n'pasted variable fps code, #ifdef-ed TV until v4l is updated
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5574 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/video.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/libmpdemux/video.c b/libmpdemux/video.c index a532a77093..21aa361d4a 100644 --- a/libmpdemux/video.c +++ b/libmpdemux/video.c @@ -279,37 +279,28 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** ++sh_video->num_frames_decoded; frame_time*=sh_video->frametime; - if(demuxer->file_format==DEMUXER_TYPE_ASF && !force_fps){ - // .ASF files has no fixed FPS - just frame durations! + + // override frame_time for variable/unknown FPS formats: + if(!force_fps) switch(demuxer->file_format){ +#ifdef HAVE_TV_BSDBT848 + case DEMUXER_TYPE_TV: +#endif + case DEMUXER_TYPE_MOV: + 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; + if(d>0 && d<5) frame_time=d; if(d>0){ if(verbose) if((int)sh_video->fps==1000) - mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\rASF framerate: %d fps \n",(int)(1.0f/d)); + 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; } - } else - if(demuxer->file_format==DEMUXER_TYPE_TV && !force_fps){ - // TV has variable video frame rate, fixed audio... - frame_time=d_video->pts-pts1; - } else - if(demuxer->file_format==DEMUXER_TYPE_MOV && !force_fps){ - // .MOV files has no fixed FPS - just frame durations! - frame_time=d_video->pts-pts1; - } else - if(demuxer->file_format==DEMUXER_TYPE_FILM && !force_fps){ - // FILM (CPK) files have no fixed FPS - just frame durations! - frame_time=d_video->pts-pts1; - } else - if(demuxer->file_format==DEMUXER_TYPE_VIVO && !force_fps){ - // .VIVO files has no fixed FPS - just frame durations! - if(d_video->pts-pts1>0) - frame_time=d_video->pts-pts1; - mp_msg(MSGT_CPLAYER,MSGL_V,"vivo frame_time=%5.3f \n",frame_time); + } } - + if(demuxer->file_format==DEMUXER_TYPE_MPEG_PS || demuxer->file_format==DEMUXER_TYPE_MPEG_ES) d_video->pts+=frame_time; @@ -318,4 +309,3 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** } - |