diff options
author | wm4 <wm4@nowhere> | 2020-07-17 01:34:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-07-20 21:02:17 +0200 |
commit | 0279a44d93a378fbdff393d6568a691817f83518 (patch) | |
tree | e81a2984f7d71cccb871f43c2c6e25c652548834 /osdep/subprocess-dummy.c | |
parent | c9742413ac5eeabfdd46503f67b7393c9bd99f49 (diff) | |
download | mpv-0279a44d93a378fbdff393d6568a691817f83518.tar.bz2 mpv-0279a44d93a378fbdff393d6568a691817f83518.tar.xz |
command: extend subprocess command
Add env and detach arguments. This means the command.c code must use the
"new" mp_subprocess2(). So also take this as an opportunity to clean up.
win32 support gets broken by it, because it never made the switch to the
newer function.
The new detach parameter makes the "run" command fully redundant, but I
guess we'll keep it for simplicity. But change its implementation to use
mp_subprocess2() (couldn't do this earlier, because win32).
Privately, I'm going to use the "env" argument to add a key binding that
starts a shell with a FILE environment variable set to the currently
playing file, so this is very useful to me.
Note: breaks windows, so for example youtube-dl on windows will not work
anymore. mp_subprocess2() has to be implemented. The old functions are
gone, and subprocess-win.c is not built anymore. It will probably work
on Cygwin.
Diffstat (limited to 'osdep/subprocess-dummy.c')
-rw-r--r-- | osdep/subprocess-dummy.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/osdep/subprocess-dummy.c b/osdep/subprocess-dummy.c index 791c90e566..df74538e71 100644 --- a/osdep/subprocess-dummy.c +++ b/osdep/subprocess-dummy.c @@ -1,9 +1,7 @@ #include "subprocess.h" -int mp_subprocess(char **args, struct mp_cancel *cancel, void *ctx, - subprocess_read_cb on_stdout, subprocess_read_cb on_stderr, - char **error) +void mp_subprocess2(struct mp_subprocess_opts *opts, + struct mp_subprocess_result *res) { - *error = "unsupported"; - return -1; + *res = (struct mp_subprocess_result){.error = MP_SUBPROCESS_EUNSUPPORTED}; } |