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 +++++++------ player/osd.c | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'player') 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 diff --git a/player/osd.c b/player/osd.c index e3fe9e1c9b..b7fb841485 100644 --- a/player/osd.c +++ b/player/osd.c @@ -238,8 +238,9 @@ static void print_status(struct MPContext *mpctx) if (opts->term_osd_bar) { saddf(&line, "\n"); - get_screen_size(); - add_term_osd_bar(mpctx, &line, screen_width); + int w = 80, h = 24; + terminal_get_size(&w, &h); + add_term_osd_bar(mpctx, &line, w); } // end -- cgit v1.2.3