summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-29 01:31:19 +0200
committerwm4 <wm4@nowhere>2013-06-29 22:58:14 +0200
commitf1fc60b32d2767df7bdfedb65f211246a49f0bcd (patch)
tree9a00edf095eb9fac82151fa26122e6810f86a19b /core
parent302852c5e3e679f2a281aaf18fba99fd823a955f (diff)
downloadmpv-f1fc60b32d2767df7bdfedb65f211246a49f0bcd.tar.bz2
mpv-f1fc60b32d2767df7bdfedb65f211246a49f0bcd.tar.xz
sub: update subtitle time offset even if paused
This was changed as part of commit b44202b as an intended simplification, but it's actually nicer to have the subtitles update immediately even if paused.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index eb99b0d2d2..b564048560 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -1782,12 +1782,10 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl)
assert(track && sh_sub);
struct dec_sub *dec_sub = sh_sub->dec_sub;
- double video_offset = track->under_timeline ? mpctx->video_offset : 0;
+ mpctx->osd->video_offset = track->under_timeline ? mpctx->video_offset : 0;
- mpctx->osd->sub_offset = video_offset - opts->sub_delay;
-
- double curpts_s = refpts_tl - mpctx->osd->sub_offset;
- double refpts_s = refpts_tl - video_offset;
+ double refpts_s = refpts_tl - mpctx->osd->video_offset;
+ double curpts_s = refpts_s + opts->sub_delay;
if (!track->preloaded) {
struct demux_stream *d_sub = sh_sub->ds;
@@ -2729,6 +2727,8 @@ static bool redraw_osd(struct MPContext *mpctx)
if (vo_redraw_frame(vo) < 0)
return false;
+ if (mpctx->sh_video)
+ update_subtitles(mpctx, mpctx->sh_video->pts);
draw_osd(mpctx);
vo_flip_page(vo, 0, -1);