From 5890e59dbc90e6ed1ae9ccec173006655895918e Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 21 Aug 2014 22:13:10 +0200 Subject: terminal: some cleanups In particular, remove all the stupid debug printfs from the win code. --- player/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'player/main.c') diff --git a/player/main.c b/player/main.c index 9de780282f..097d180dc1 100644 --- a/player/main.c +++ b/player/main.c @@ -132,9 +132,6 @@ void mp_destroy(struct MPContext *mpctx) command_uninit(mpctx); - mp_dispatch_set_wakeup_fn(mpctx->dispatch, NULL, NULL); - mp_input_uninit(mpctx->input); - osd_free(mpctx->osd); #if HAVE_LIBASS @@ -142,10 +139,14 @@ void mp_destroy(struct MPContext *mpctx) ass_library_done(mpctx->ass_library); #endif - if (mpctx->opts->use_terminal) { - getch2_disable(); + if (mpctx->opts->use_terminal && terminal_initialized) { + terminal_uninit(); terminal_initialized = false; } + + mp_dispatch_set_wakeup_fn(mpctx->dispatch, NULL, NULL); + mp_input_uninit(mpctx->input); + uninit_libav(mpctx->global); if (mpctx->autodetach) @@ -403,7 +404,7 @@ int mp_initialize(struct MPContext *mpctx) } #endif - if (opts->use_terminal && opts->consolecontrols) + if (opts->use_terminal && opts->consolecontrols && terminal_initialized) terminal_setup_getch(mpctx->input); #if HAVE_LIBASS -- cgit v1.2.3