summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/command.c b/command.c
index cbac7ebb1a..1b0ff9dfeb 100644
--- a/command.c
+++ b/command.c
@@ -2365,18 +2365,22 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
if (sh_video) {
int movement = cmd->args[0].v.i;
struct track *track = mpctx->current_track[STREAM_SUB];
- if (track && track->subdata)
+ bool available = false;
+ if (track && track->subdata) {
+ available = true;
step_sub(track->subdata, mpctx->video_pts, movement);
-#if 0
- // currently not implemented with libass
- if (mpctx->osd->ass_track)
- sub_delay +=
- ass_step_sub(mpctx->osd->ass_track,
- (mpctx->video_pts +
- sub_delay) * 1000 + .5, movement) / 1000.;
+ }
+#ifdef CONFIG_ASS
+ struct ass_track *ass_track = sub_get_ass_track(mpctx->osd);
+ if (ass_track) {
+ available = true;
+ sub_delay += ass_step_sub(ass_track,
+ (mpctx->video_pts + sub_delay) * 1000 + .5, movement) / 1000.;
+ }
#endif
- set_osd_tmsg(mpctx, OSD_MSG_SUB_DELAY, 1, osd_duration,
- "Sub delay: %d ms", ROUND(sub_delay * 1000));
+ if (available)
+ set_osd_tmsg(mpctx, OSD_MSG_SUB_DELAY, 1, osd_duration,
+ "Sub delay: %d ms", ROUND(sub_delay * 1000));
}
break;