From cdcdddfc63ecccc026d179bf619c2df5bfe98f6c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 6 Jun 2014 17:28:13 +0200 Subject: 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. --- player/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'player') 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); -- cgit v1.2.3