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.
This commit is contained in:
wm4 committed 2014-06-06 17:28:13 +02:00
1 parent ecbb12923f
commit cdcdddfc63
1 file changed
+4 -1
+4 -1
View File
@@ -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);