From 50c379e2d8a2cee0fcdbadbcbf5d0a0617fdafec Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 27 Dec 2015 01:25:32 +0100 Subject: sub: minor refactor how video FPS for MicroDVD is set So that the video FPs is not required at initialization, and can be set later. (As for whether this MicroDVD crap is worth the trouble to handle it "correctly": MicroDVD files are unfortunately still around, and in at least one case using the video FPS seemed to help indeed.) --- player/sub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'player/sub.c') diff --git a/player/sub.c b/player/sub.c index 059dbdc2fd..e1e411e2ec 100644 --- a/player/sub.c +++ b/player/sub.c @@ -152,12 +152,12 @@ static void reinit_subdec(struct MPContext *mpctx, struct track *track) if (sub_is_initialized(dec_sub)) return; + sub_init(dec_sub, track->demuxer, track->stream); + struct sh_video *sh_video = mpctx->d_video ? mpctx->d_video->header->video : NULL; - float fps = sh_video ? sh_video->fps : 25; - - sub_set_video_fps(dec_sub, fps); - sub_init(dec_sub, track->demuxer, track->stream); + double fps = sh_video ? sh_video->fps : 25; + sub_control(dec_sub, SD_CTRL_SET_VIDEO_DEF_FPS, &fps); // Don't do this if the file has video/audio streams. Don't do it even // if it has only sub streams, because reading packets will change the -- cgit v1.2.3