diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-03-20 02:54:19 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-03-25 22:30:37 +0300 |
commit | 06e3dc8eba756778e0cca6f55e24f0ae39d4489f (patch) | |
tree | 843f3c06a6d9139ba8c6f79c03e972b229df93ea /mp_core.h | |
parent | 1ff7efe2ec1511033ce9174bbe038696375b3d41 (diff) | |
download | mpv-06e3dc8eba756778e0cca6f55e24f0ae39d4489f.tar.bz2 mpv-06e3dc8eba756778e0cca6f55e24f0ae39d4489f.tar.xz |
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.
Diffstat (limited to 'mp_core.h')
-rw-r--r-- | mp_core.h | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -255,8 +255,7 @@ char *chapter_display_name(struct MPContext *mpctx, int chapter); char *chapter_name(struct MPContext *mpctx, int chapter); double chapter_start_time(struct MPContext *mpctx, int chapter); int get_chapter_count(struct MPContext *mpctx); -void update_subtitles(struct MPContext *mpctx, double refpts, - double sub_offset, bool reset); +void update_subtitles(struct MPContext *mpctx, double refpts, bool reset); // timeline/tl_matroska.c |