summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-03-20 02:54:19 +0200
committerUoti Urpala <uau@mplayer2.org>2012-03-25 22:30:37 +0300
commit06e3dc8eba756778e0cca6f55e24f0ae39d4489f (patch)
tree843f3c06a6d9139ba8c6f79c03e972b229df93ea /sub
parent1ff7efe2ec1511033ce9174bbe038696375b3d41 (diff)
downloadmpv-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 'sub')
-rw-r--r--sub/sub.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sub/sub.h b/sub/sub.h
index 2f8c4e0ffc..081834e3bb 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -76,6 +76,7 @@ struct osd_state {
struct font_desc *sub_font;
struct ass_track *ass_track;
double pts;
+ double sub_offset;
bool ass_track_changed;
bool vsfilter_aspect;
};