mirror of
https://github.com/mpv-player/mpv
synced 2025-03-06 22:28:01 +00:00
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.
This commit is contained in:
parent
922b1d8504
commit
ee6df2f76c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user