comparison libmpdemux/video.c @ 6371:622d57683187

Fix asf stream wich were giving invalid frame times because the frame time was 0.
author albeu
date Mon, 10 Jun 2002 09:59:44 +0000
parents 68cac7ecaf05
children 13cf65db9ebc
comparison
equal deleted inserted replaced
6370:1ae3a153f380 6371:622d57683187
291 case DEMUXER_TYPE_FILM: 291 case DEMUXER_TYPE_FILM:
292 case DEMUXER_TYPE_VIVO: 292 case DEMUXER_TYPE_VIVO:
293 case DEMUXER_TYPE_ASF: { 293 case DEMUXER_TYPE_ASF: {
294 float next_pts = ds_get_next_pts(d_video); 294 float next_pts = ds_get_next_pts(d_video);
295 float d= next_pts > 0 ? next_pts - d_video->pts : d_video->pts-pts1; 295 float d= next_pts > 0 ? next_pts - d_video->pts : d_video->pts-pts1;
296 if(d>0){ 296 if(d>=0){
297 if(verbose) 297 if(verbose)
298 if((int)sh_video->fps==1000) 298 if((int)sh_video->fps==1000)
299 mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\navg. framerate: %d fps \n",(int)(1.0f/d)); 299 mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\navg. framerate: %d fps \n",(int)(1.0f/d));
300 sh_video->frametime=d; // 1ms 300 sh_video->frametime=d; // 1ms
301 sh_video->fps=1.0f/d; 301 sh_video->fps=1.0f/d;
302 frame_time = d; 302 frame_time = d;
303 } else { 303 } else {
304 mp_msg(MSGT_CPLAYER,MSGL_WARN,"\nInvalid frame duration value. Defaulting to 1/25 sec.\n"); 304 mp_msg(MSGT_CPLAYER,MSGL_WARN,"\nInvalid frame duration value (%2.5f/%2.5f => %2.5f). Defaulting to 1/25 sec.\n",d_video->pts,next_pts,d);
305 frame_time = 1/25.0; 305 frame_time = 1/25.0;
306 } 306 }
307 } 307 }
308 } 308 }
309 309