From 06e3dc8eba756778e0cca6f55e24f0ae39d4489f Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 20 Mar 2012 02:54:19 +0200 Subject: timeline: subs: keep subtitle tracks in source time Timeline handling converted the pts values from demuxed subtitles to timeline scale. Change the code to do most subtitle handling in original subtitle source pts, and instead convert current playback timeline pts to those units when deciding which subtitle to show. The main functionality changes are that now demuxed subtitles which overlap chapter boundaries are handled correctly (at least for libass subtitles), and external subtitles are assumed to use same pts scale as current source (this needs improvements later). Before, a video subtitle that had a duration continuing past the end of the chapter would continue to be shown for the original duration, even if the chapter ended and playback switched to a position in the source where the subtitle shouldn't exist. Now, the subtitle will correctly end. Before, external subtitle files were interpreted as specifying pts values in timeline scale. Now, they're interpreted as specifying pts values in source file time scale, for _every_ source file. This is probably more likely to be what the user wants for the "main" source file in case there is one, but almost certainly not quite right for multiple source files where the same subs could be shown over different scenes. If the user wants them to match some main source file, it's probably still better to have incorrect extra subs for video from some files than to have every subtitle appearing at the wrong time. The new code makes it easier to change the interpretation of the subtitle times, and some configurability should be added in the future. --- command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'command.c') diff --git a/command.c b/command.c index 48f0ecb013..7ce0e7e924 100644 --- a/command.c +++ b/command.c @@ -1767,7 +1767,7 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg, } #endif - update_subtitles(mpctx, 0, 0, true); + update_subtitles(mpctx, 0, true); return M_PROPERTY_OK; } -- cgit v1.2.3