summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-29 23:28:31 +0100
committerwm4 <wm4@nowhere>2013-01-12 00:52:27 +0100
commit46f84297946281fac5ba9f3d8d569f126c200d1a (patch)
treedc05e129c1dc9b8cadfd513e45eef2b922597119 /core
parent944be9d24bbf748ce65feda44e8df75fd1950bc6 (diff)
downloadmpv-46f84297946281fac5ba9f3d8d569f126c200d1a.tar.bz2
mpv-46f84297946281fac5ba9f3d8d569f126c200d1a.tar.xz
sub: do not apply timeline offset to external subtitles
Now external subtitles essentially use the playback time, instead of the segment time. This is more useful when using external subtitles with mkv ordered chapters. The previous behavior is not necessarily incorrect, and e.g. makes it easier to use subtitles directly extracted from ordered chapters segments. But we consider the new behavior more useful. Also see commit 06e3dc8.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 17b5404537..2e445cf81e 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -1761,21 +1761,26 @@ static void reset_subtitles(struct MPContext *mpctx)
static void update_subtitles(struct MPContext *mpctx, double refpts_tl)
{
- mpctx->osd->sub_offset = mpctx->video_offset;
struct MPOpts *opts = &mpctx->opts;
struct sh_video *sh_video = mpctx->sh_video;
struct sh_sub *sh_sub = mpctx->sh_sub;
struct demux_stream *d_sub = sh_sub ? sh_sub->ds : NULL;
- double refpts_s = refpts_tl - mpctx->osd->sub_offset;
- double curpts_s = refpts_s + sub_delay;
unsigned char *packet = NULL;
int len;
int type = sh_sub ? sh_sub->type : '\0';
+ mpctx->osd->sub_offset = mpctx->video_offset;
+
struct track *track = mpctx->current_track[STREAM_SUB];
if (!track)
return;
+ if (!track->under_timeline)
+ mpctx->osd->sub_offset = 0;
+
+ double refpts_s = refpts_tl - mpctx->osd->sub_offset;
+ double curpts_s = refpts_s + sub_delay;
+
// find sub
if (track->subdata) {
if (sub_fps == 0)