mirror of
https://github.com/mpv-player/mpv
synced 2025-03-02 04:11:03 +00:00
Remove INITIALIZED_INPUT from mpctx->initialized_flags
The input functions are never uninited except at exit. Move the uninit to player exit function and remove the flag.
This commit is contained in:
parent
7b085d4514
commit
66db9ec7d6
@ -1770,6 +1770,9 @@ struct input_ctx *mp_input_init(int use_gui)
|
|||||||
|
|
||||||
void mp_input_uninit(struct input_ctx *ictx)
|
void mp_input_uninit(struct input_ctx *ictx)
|
||||||
{
|
{
|
||||||
|
if (!ictx)
|
||||||
|
return;
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
mp_cmd_bind_section_t* bind_section;
|
mp_cmd_bind_section_t* bind_section;
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#define INITIALIZED_GETCH2 8
|
#define INITIALIZED_GETCH2 8
|
||||||
#define INITIALIZED_SPUDEC 32
|
#define INITIALIZED_SPUDEC 32
|
||||||
#define INITIALIZED_STREAM 64
|
#define INITIALIZED_STREAM 64
|
||||||
#define INITIALIZED_INPUT 128
|
|
||||||
#define INITIALIZED_VOBSUB 256
|
#define INITIALIZED_VOBSUB 256
|
||||||
#define INITIALIZED_DEMUXER 512
|
#define INITIALIZED_DEMUXER 512
|
||||||
#define INITIALIZED_ACODEC 1024
|
#define INITIALIZED_ACODEC 1024
|
||||||
|
22
mplayer.c
22
mplayer.c
@ -644,16 +644,6 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(mask&INITIALIZED_INPUT){
|
|
||||||
mpctx->initialized_flags&=~INITIALIZED_INPUT;
|
|
||||||
current_module="uninit_input";
|
|
||||||
mp_input_uninit(mpctx->input);
|
|
||||||
#ifdef HAVE_MENU
|
|
||||||
if (use_menu)
|
|
||||||
menu_uninit();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
current_module=NULL;
|
current_module=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,6 +658,13 @@ void exit_player_with_rc(struct MPContext *mpctx, const char* how, int rc){
|
|||||||
vo_uninit(mpctx->x11_state); // Close the X11 connection (if any is open).
|
vo_uninit(mpctx->x11_state); // Close the X11 connection (if any is open).
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
current_module="uninit_input";
|
||||||
|
mp_input_uninit(mpctx->input);
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
if (use_menu)
|
||||||
|
menu_uninit();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FREETYPE
|
#ifdef HAVE_FREETYPE
|
||||||
current_module="uninit_font";
|
current_module="uninit_font";
|
||||||
if (sub_font && sub_font != vo_font) free_font_desc(sub_font);
|
if (sub_font && sub_font != vo_font) free_font_desc(sub_font);
|
||||||
@ -2904,7 +2901,6 @@ stream_set_interrupt_callback(mp_input_check_interrupt, mpctx->input);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mpctx->initialized_flags|=INITIALIZED_INPUT;
|
|
||||||
current_module = NULL;
|
current_module = NULL;
|
||||||
|
|
||||||
/// Catch signals
|
/// Catch signals
|
||||||
@ -3944,7 +3940,7 @@ mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",mpctx->eof);
|
|||||||
if(mpctx->dvbin_reopen)
|
if(mpctx->dvbin_reopen)
|
||||||
{
|
{
|
||||||
mpctx->eof = 0;
|
mpctx->eof = 0;
|
||||||
uninit_player(mpctx, INITIALIZED_ALL-(INITIALIZED_GUI|INITIALIZED_STREAM|INITIALIZED_INPUT|INITIALIZED_GETCH2|(opts->fixed_vo?INITIALIZED_VO:0)));
|
uninit_player(mpctx, INITIALIZED_ALL-(INITIALIZED_GUI|INITIALIZED_STREAM|INITIALIZED_GETCH2|(opts->fixed_vo?INITIALIZED_VO:0)));
|
||||||
cache_uninit(mpctx->stream);
|
cache_uninit(mpctx->stream);
|
||||||
mpctx->dvbin_reopen = 0;
|
mpctx->dvbin_reopen = 0;
|
||||||
goto goto_enable_cache;
|
goto goto_enable_cache;
|
||||||
@ -3982,7 +3978,7 @@ if(benchmark){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// time to uninit all, except global stuff:
|
// time to uninit all, except global stuff:
|
||||||
uninit_player(mpctx, INITIALIZED_ALL-(INITIALIZED_GUI+INITIALIZED_INPUT+(opts->fixed_vo?INITIALIZED_VO:0)));
|
uninit_player(mpctx, INITIALIZED_ALL-(INITIALIZED_GUI+(opts->fixed_vo?INITIALIZED_VO:0)));
|
||||||
|
|
||||||
if(mpctx->set_of_sub_size > 0) {
|
if(mpctx->set_of_sub_size > 0) {
|
||||||
current_module="sub_free";
|
current_module="sub_free";
|
||||||
|
Loading…
Reference in New Issue
Block a user