0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02: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:
Uoti Urpala 2008-04-30 09:14:06 +03:00
parent 7b085d4514
commit 66db9ec7d6
3 changed files with 12 additions and 14 deletions

View File

@ -1770,6 +1770,9 @@ struct input_ctx *mp_input_init(int use_gui)
void mp_input_uninit(struct input_ctx *ictx)
{
if (!ictx)
return;
unsigned int i;
mp_cmd_bind_section_t* bind_section;

View File

@ -13,7 +13,6 @@
#define INITIALIZED_GETCH2 8
#define INITIALIZED_SPUDEC 32
#define INITIALIZED_STREAM 64
#define INITIALIZED_INPUT 128
#define INITIALIZED_VOBSUB 256
#define INITIALIZED_DEMUXER 512
#define INITIALIZED_ACODEC 1024

View File

@ -644,16 +644,6 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask){
}
#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;
}
@ -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).
#endif
current_module="uninit_input";
mp_input_uninit(mpctx->input);
#ifdef HAVE_MENU
if (use_menu)
menu_uninit();
#endif
#ifdef HAVE_FREETYPE
current_module="uninit_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
mpctx->initialized_flags|=INITIALIZED_INPUT;
current_module = NULL;
/// Catch signals
@ -3944,7 +3940,7 @@ mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",mpctx->eof);
if(mpctx->dvbin_reopen)
{
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);
mpctx->dvbin_reopen = 0;
goto goto_enable_cache;
@ -3982,7 +3978,7 @@ if(benchmark){
}
// 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) {
current_module="sub_free";