diff options
author | wm4 <wm4@nowhere> | 2015-01-01 20:37:49 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-01 20:37:49 +0100 |
commit | 4c3f0427775273fe3925f631ea46891af56020aa (patch) | |
tree | 333c0c43c18efe64612618a7401fc4d788efe990 /common | |
parent | 44701238c73ba8f50fb16c675e2db3555902ac7a (diff) |
command: make the "run" command work on Windows too
Do so by using mp_subprocess(). Although this uses completely different
code on Unix too, you shouldn't notice a difference. A less ncie thing
is that this reserves an entire thread while the command is running
(which wastes some memory for stack, at least). But this is probably
still the simplest way, and the fork() trick is apparently not
implementable with posix_subprocess().
Diffstat (limited to 'common')
-rw-r--r-- | common/msg.c | 5 | ||||
-rw-r--r-- | common/msg_control.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/common/msg.c b/common/msg.c index 4a4ad80884..e117589873 100644 --- a/common/msg.c +++ b/common/msg.c @@ -185,10 +185,11 @@ static void flush_status_line(struct mp_log_root *root) root->blank_lines = 0; } -void mp_msg_flush_status_line(struct mpv_global *global) +void mp_msg_flush_status_line(struct mp_log *log) { pthread_mutex_lock(&mp_msg_lock); - flush_status_line(global->log->root); + if (log->root) + flush_status_line(log->root); pthread_mutex_unlock(&mp_msg_lock); } diff --git a/common/msg_control.h b/common/msg_control.h index b0ceef01df..57a7d85368 100644 --- a/common/msg_control.h +++ b/common/msg_control.h @@ -9,9 +9,10 @@ void mp_msg_uninit(struct mpv_global *global); void mp_msg_update_msglevels(struct mpv_global *global); void mp_msg_mute(struct mpv_global *global, bool mute); void mp_msg_force_stderr(struct mpv_global *global, bool force_stderr); -void mp_msg_flush_status_line(struct mpv_global *global); bool mp_msg_has_status_line(struct mpv_global *global); +void mp_msg_flush_status_line(struct mp_log *log); + struct mp_log_buffer_entry { char *prefix; int level; |