osdep/subprocess: log subprocess error as verbose if killed by us

Fixes: https://github.com/po5/thumbfast/issues/133#issuecomment-2413618437
This commit is contained in:
Kacper Michajłow 2024-10-15 16:26:52 +02:00
parent 187fffd0f5
commit f33b89ca29
1 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,8 @@ void mp_subprocess(struct mp_log *log,
mp_verbose(log, ", %s", *arg++); mp_verbose(log, ", %s", *arg++);
mp_verbose(log, "]\n"); mp_verbose(log, "]\n");
mp_subprocess2(opts, res); mp_subprocess2(opts, res);
if (res->error < 0) if (res->error < 0) {
mp_err(log, "Subprocess failed: %s\n", mp_subprocess_err_str(res->error)); int lev = res->error == MP_SUBPROCESS_EKILLED_BY_US ? MSGL_V : MSGL_ERR;
mp_msg(log, lev, "Subprocess failed: %s\n", mp_subprocess_err_str(res->error));
}
} }