From 00de44eec90e45f4801e45d636b6759e1fdb9d2f Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 25 Jun 2013 00:03:37 +0200 Subject: options: add -sub-speed option Should we actually get into trouble for unproper handling of frame-based subtitle formats, this might be the simplest way to work this around. Also is a bit more intuitive than -subfps, which might use an unknown, misdetected, or non-sense video FPS. Still pretty silly, though. --- sub/dec_sub.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sub/dec_sub.c') diff --git a/sub/dec_sub.c b/sub/dec_sub.c index 968ca3e39f..a1392017a2 100644 --- a/sub/dec_sub.c +++ b/sub/dec_sub.c @@ -401,12 +401,19 @@ bool sub_read_all_packets(struct dec_sub *sub, struct sh_sub *sh) if (sub->charset) mp_msg(MSGT_OSD, MSGL_INFO, "Using subtitle charset: %s\n", sub->charset); + double sub_speed = 1.0; + // 23.976 FPS is used as default timebase for frame based formats if (sub->video_fps && sh->frame_based) - multiply_timings(subs, sub->video_fps / 23.976); + sub_speed *= sub->video_fps / 23.976; if (opts->sub_fps && sub->video_fps) - multiply_timings(subs, opts->sub_fps / sub->video_fps); + sub_speed *= opts->sub_fps / sub->video_fps; + + sub_speed *= opts->sub_speed; + + if (sub_speed != 1.0) + multiply_timings(subs, sub_speed); if (!opts->suboverlap_enabled) fix_overlaps_and_gaps(subs); -- cgit v1.2.3