summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-17 01:54:02 +0100
committerwm4 <wm4@nowhere>2015-11-17 01:56:23 +0100
commit5a89150a4652d987f24d7d386d5cdc6d9109e66d (patch)
treefc6085143661672f537a604b6645f79e0dced3ad /player/command.c
parent85450d06a1b1a08fce277f7f14d5ee33b12f8eab (diff)
downloadmpv-5a89150a4652d987f24d7d386d5cdc6d9109e66d.tar.bz2
mpv-5a89150a4652d987f24d7d386d5cdc6d9109e66d.tar.xz
player: remove OSD subtitle render path
This was used with --no-sub-ass (aka --no-ass). This option (which is not yet removed) strips all styling from the subtitles, and renders them as plaintext only. For some reason, it originally seemed convenient to reuse all the OSD text rendering code (osd_libass.c). While this was indeed simple, it had a bad influence on the rest of the code. For example, it had to decide whether to go through the OSD code path, or the proper subtitle renderer in sd_ass.c. Kill the OSD subtitle renderer. Reimplement --no-sub-ass and also "secondary" subtitles in sd_ass.c. fill_plaintext() contains some rather minor code duplication with osd_libass.c for setting up a dummy ASS_Event and escaping the stripped text. Since sd_ass.c already has to handle "normal" text subtitles, and has code for stripping ASS tags, this remains all relatively simple. Remove all the unnecessary crap from the rest of the code.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/player/command.c b/player/command.c
index f6ccf22cae..7d520d78ac 100644
--- a/player/command.c
+++ b/player/command.c
@@ -4472,14 +4472,13 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
case MP_CMD_SUB_SEEK: {
if (!mpctx->playback_initialized)
return -1;
- struct osd_sub_state state;
- update_osd_sub_state(mpctx, 0, &state);
+ struct dec_sub *sub = mpctx->d_sub[0];
double refpts = get_current_time(mpctx);
- if (state.dec_sub && refpts != MP_NOPTS_VALUE) {
+ if (sub && refpts != MP_NOPTS_VALUE) {
double a[2];
a[0] = refpts - opts->sub_delay;
a[1] = cmd->args[0].v.i;
- if (sub_control(state.dec_sub, SD_CTRL_SUB_STEP, a) > 0) {
+ if (sub_control(sub, SD_CTRL_SUB_STEP, a) > 0) {
if (cmd->id == MP_CMD_SUB_STEP) {
opts->sub_delay -= a[0];
osd_changed_all(mpctx->osd);