mirror of https://github.com/mpv-player/mpv
Fix subtitle delay inversion
This commit is contained in:
parent
df116958df
commit
e62c917abf
|
@ -102,7 +102,7 @@ static void update_subtitle(struct MPContext *mpctx, int order)
|
||||||
osd_obj->video_offset = track->under_timeline ? mpctx->video_offset : 0;
|
osd_obj->video_offset = track->under_timeline ? mpctx->video_offset : 0;
|
||||||
|
|
||||||
double refpts_s = mpctx->playback_pts - osd_obj->video_offset;
|
double refpts_s = mpctx->playback_pts - osd_obj->video_offset;
|
||||||
double curpts_s = refpts_s + opts->sub_delay;
|
double curpts_s = refpts_s - opts->sub_delay;
|
||||||
|
|
||||||
if (!track->preloaded && track->stream) {
|
if (!track->preloaded && track->stream) {
|
||||||
struct sh_stream *sh_stream = track->stream;
|
struct sh_stream *sh_stream = track->stream;
|
||||||
|
|
|
@ -162,7 +162,7 @@ static void render_object(struct osd_state *osd, struct osd_object *obj,
|
||||||
if (obj->render_bitmap_subs && obj->dec_sub) {
|
if (obj->render_bitmap_subs && obj->dec_sub) {
|
||||||
double sub_pts = video_pts;
|
double sub_pts = video_pts;
|
||||||
if (sub_pts != MP_NOPTS_VALUE)
|
if (sub_pts != MP_NOPTS_VALUE)
|
||||||
sub_pts -= obj->video_offset - opts->sub_delay;
|
sub_pts -= obj->video_offset + opts->sub_delay;
|
||||||
sub_get_bitmaps(obj->dec_sub, obj->vo_res, sub_pts, out_imgs);
|
sub_get_bitmaps(obj->dec_sub, obj->vo_res, sub_pts, out_imgs);
|
||||||
} else {
|
} else {
|
||||||
osd_object_get_bitmaps(osd, obj, out_imgs);
|
osd_object_get_bitmaps(osd, obj, out_imgs);
|
||||||
|
|
Loading…
Reference in New Issue