diff options
author | wm4 <wm4@nowhere> | 2013-06-29 01:31:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-29 22:58:14 +0200 |
commit | f1fc60b32d2767df7bdfedb65f211246a49f0bcd (patch) | |
tree | 9a00edf095eb9fac82151fa26122e6810f86a19b | |
parent | 302852c5e3e679f2a281aaf18fba99fd823a955f (diff) | |
download | mpv-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.
-rw-r--r-- | core/mplayer.c | 10 | ||||
-rw-r--r-- | sub/sub.c | 2 | ||||
-rw-r--r-- | sub/sub.h | 2 |
3 files changed, 7 insertions, 7 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); @@ -160,7 +160,7 @@ static void render_object(struct osd_state *osd, struct osd_object *obj, if (osd->render_bitmap_subs && osd->dec_sub) { double sub_pts = video_pts; if (sub_pts != MP_NOPTS_VALUE) - sub_pts -= osd->sub_offset; + sub_pts -= osd->video_offset - opts->sub_delay; sub_get_bitmaps(osd->dec_sub, obj->vo_res, sub_pts, out_imgs); } } else { @@ -120,7 +120,7 @@ struct osd_state { struct ass_library *ass_library; struct ass_renderer *ass_renderer; - double sub_offset; + double video_offset; double vo_pts; bool render_subs_in_filter; |