From ee6df2f76c7c8a7c26d905444529dc3b755d8548 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 4 Aug 2014 18:13:09 +0200 Subject: sub: fix subtitle timing for TS The subtitle timing logic always used the demuxer's start time as video offset. This made external subtitle files "just work" with file formats like TS, which usually have a non-0 start time. But it was wrong for subtitles muxed with the TS, so adjust the time offset explicitly with external files only. --- player/sub.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/sub.c b/player/sub.c index 4478b1092c..d6903c146e 100644 --- a/player/sub.c +++ b/player/sub.c @@ -107,8 +107,12 @@ static void update_subtitle(struct MPContext *mpctx, int order) struct osd_sub_state state; osd_get_sub(mpctx->osd, obj, &state); - state.video_offset = - track->under_timeline ? mpctx->video_offset : get_start_time(mpctx); + state.video_offset = 0; + if (track->under_timeline) { + state.video_offset += mpctx->video_offset; + } else if (track->is_external) { + state.video_offset += get_start_time(mpctx); + }; osd_set_sub(mpctx->osd, obj, &state); -- cgit v1.2.3