From 46f84297946281fac5ba9f3d8d569f126c200d1a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 29 Dec 2012 23:28:31 +0100 Subject: 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. --- core/mplayer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'core') 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) -- cgit v1.2.3