mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 04:58:06 +00:00
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:
parent
ecbb12923f
commit
cdcdddfc63
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user