summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-06 17:28:13 +0200
committerwm4 <wm4@nowhere>2014-06-06 17:28:13 +0200
commitcdcdddfc63ecccc026d179bf619c2df5bfe98f6c (patch)
treea730c239eab7461376669622d467c773d7438f2d
parentecbb12923fe50ae2b44120cc823fe0bf748dadf3 (diff)
downloadmpv-cdcdddfc63ecccc026d179bf619c2df5bfe98f6c.tar.bz2
mpv-cdcdddfc63ecccc026d179bf619c2df5bfe98f6c.tar.xz
client API: fix terminal usage
By default this is disabled. But if it's enabled, then we have to account for proper states when enabling/disabling the terminal state itself.
-rw-r--r--player/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/player/main.c b/player/main.c
index 40e2dd8841..0bfd25bdd5 100644
--- a/player/main.c
+++ b/player/main.c
@@ -142,8 +142,10 @@ void mp_destroy(struct MPContext *mpctx)
ass_library_done(mpctx->ass_library);
#endif
- if (mpctx->opts->use_terminal)
+ if (mpctx->opts->use_terminal) {
getch2_disable();
+ terminal_initialized = false;
+ }
uninit_libav(mpctx->global);
mp_msg_uninit(mpctx->global);
@@ -368,6 +370,7 @@ int mp_initialize(struct MPContext *mpctx)
if (mpctx->opts->use_terminal && !terminal_initialized) {
terminal_initialized = true;
terminal_init();
+ mp_msg_update_msglevels(mpctx->global);
}
mpctx->input = mp_input_init(mpctx->global);