summaryrefslogtreecommitdiffstats
path: root/player/sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-27 01:25:32 +0100
committerwm4 <wm4@nowhere>2015-12-27 02:13:06 +0100
commit50c379e2d8a2cee0fcdbadbcbf5d0a0617fdafec (patch)
treea499e78204d23327a3fde44da22ebac1425b4679 /player/sub.c
parentd9f8b9f7b235e6092a1e8b35041757e28e08de04 (diff)
downloadmpv-50c379e2d8a2cee0fcdbadbcbf5d0a0617fdafec.tar.bz2
mpv-50c379e2d8a2cee0fcdbadbcbf5d0a0617fdafec.tar.xz
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.)
Diffstat (limited to 'player/sub.c')
-rw-r--r--player/sub.c8
1 files changed, 4 insertions, 4 deletions
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