1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00

core: remove bad workaround for files without FPS set

Commit dde8b753e4 merged an mplayer1 change (r31328) that set
correct_pts to true if FPS was not set (on the assumption that
correct-pts mode could provide proper timing without FPS). As the
merge commit noted this change was somewhat questionable, as the
option shouldn't really change after things have already been
initialized. After recent changes it can cause an outright crash
(assert in ds_get_packet2() from 9c7c4e5b7d fails). Remove the hack.
Also only print a warning about not having FPS if correct_pts is not
set (in correct_pts mode not having FPS shouldn't be a real problem,
as everything is based on timestamps anyway).
This commit is contained in:
Uoti Urpala 2011-08-25 02:45:13 +03:00
parent 8cc5ba5ab8
commit 9fe2fa599b

View File

@ -4777,7 +4777,6 @@ goto_enable_cache:
mpctx->sh_video = mpctx->d_video->sh;
if (mpctx->sh_video) {
current_module = "video_read_properties";
if (!video_read_properties(mpctx->sh_video)) {
mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "Video: Cannot read properties.\n");
@ -4787,20 +4786,16 @@ goto_enable_cache:
"size:%dx%d fps:%5.3f ftime:=%6.4f\n",
mpctx->demuxer->file_format, mpctx->sh_video->format,
mpctx->sh_video->disp_w, mpctx->sh_video->disp_h,
mpctx->sh_video->fps, mpctx->sh_video->frametime
);
/* need to set fps here for output encoders to pick it up in their init */
mpctx->sh_video->fps, mpctx->sh_video->frametime);
if (force_fps) {
mpctx->sh_video->fps = force_fps;
mpctx->sh_video->frametime = 1.0f / mpctx->sh_video->fps;
}
vo_fps = mpctx->sh_video->fps;
if (!mpctx->sh_video->fps && !force_fps) {
if (!mpctx->sh_video->fps && !force_fps && !opts->correct_pts) {
mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "FPS not specified in the "
"header or invalid, use the -fps option.\n");
mpctx->opts.correct_pts = 1;
}
}