diff options
author | wm4 <wm4@nowhere> | 2013-06-29 01:34:11 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-29 22:58:14 +0200 |
commit | e5c094754157102a964364041d6fb0caf2188809 (patch) | |
tree | e6bb02b7408c40651d620ac523fb2ffdf3f17cc7 /core | |
parent | 00b0f42c42724346190d350e8801e19d8d7b9a23 (diff) | |
download | mpv-e5c094754157102a964364041d6fb0caf2188809.tar.bz2 mpv-e5c094754157102a964364041d6fb0caf2188809.tar.xz |
dec_sub: introduce sub_control(), use it for sub_step
This means the direct libass usage can be removed from command.c, and no
weird hacks for retrieving the ASS_Track are needed.
Also fix a bug when using this feature with ordered chapters.
Diffstat (limited to 'core')
-rw-r--r-- | core/command.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/command.c b/core/command.c index f273bda2b2..453ddbe974 100644 --- a/core/command.c +++ b/core/command.c @@ -55,7 +55,6 @@ #include "video/decode/dec_video.h" #include "audio/decode/dec_audio.h" #include "core/path.h" -#include "sub/ass_mp.h" #include "stream/tv.h" #include "stream/stream_radio.h" #include "stream/pvr.h" @@ -2087,18 +2086,18 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) } case MP_CMD_SUB_STEP: -#ifdef CONFIG_ASS if (mpctx->osd->dec_sub) { - int movement = cmd->args[0].v.i; - struct ass_track *ass_track = sub_get_ass_track(mpctx->osd->dec_sub); - if (ass_track) { + double a[2]; + a[0] = mpctx->video_pts - mpctx->osd->video_offset + opts->sub_delay; + a[1] = cmd->args[0].v.i; + if (sub_control(mpctx->osd->dec_sub, SD_CTRL_SUB_STEP, a) > 0) { + opts->sub_delay += a[0]; + + osd_changed_all(mpctx->osd); set_osd_tmsg(mpctx, OSD_MSG_SUB_DELAY, osdl, osd_duration, "Sub delay: %d ms", ROUND(opts->sub_delay * 1000)); - double cur = (mpctx->video_pts + opts->sub_delay) * 1000 + .5; - opts->sub_delay += ass_step_sub(ass_track, cur, movement) / 1000.; } } -#endif break; case MP_CMD_OSD: { |