options: compatibility hack for --slave-broken

Seems some programs were still relying on it. Whatever, it's not hard to
support.

CC: @mpv-player/stable
This commit is contained in:
wm4 2014-08-24 20:34:04 +02:00 committed by Alessandro Ghedini
parent 5523370ab9
commit 226735331c
4 changed files with 12 additions and 0 deletions

View File

@ -332,6 +332,8 @@ Slave mode
Assuming the system supports ``/dev/stdin``.
(The option was readded in 0.5.1 and sets exactly these options.)
* A JSON RPC protocol giving access to the client API is planned, but nothing
has emerged yet.

View File

@ -527,6 +527,8 @@ const m_option_t mp_opts[] = {
OPT_SUBSTRUCT("", encode_opts, encode_config, 0),
#endif
OPT_FLAG("slave-broken", slave_mode, CONF_GLOBAL),
{0}
};

View File

@ -237,6 +237,8 @@ typedef struct MPOpts {
int w32_priority;
int slave_mode;
int network_cookies_enabled;
char *network_cookies_file;
char *network_useragent;

View File

@ -375,6 +375,12 @@ int mp_initialize(struct MPContext *mpctx)
mp_msg_update_msglevels(mpctx->global);
}
if (opts->slave_mode) {
MP_WARN(mpctx, "--slave-broken is deprecated (see manpage).\n");
opts->consolecontrols = 0;
m_config_set_option0(mpctx->mconfig, "input-file", "/dev/stdin");
}
mpctx->input = mp_input_init(mpctx->global);
mpctx->global->stream_interrupt_cb = check_stream_interrupt;
mpctx->global->stream_interrupt_cb_ctx = mpctx;