diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-30 09:14:06 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-30 13:24:56 +0300 |
commit | 66db9ec7d6a9f869dc922ad9a9b8a5d278577bab (patch) | |
tree | 7a8e265871b095ca366b794f94d89c75765ee07b | |
parent | 7b085d4514d091945492cb00fa5a98bbd1bc7cf8 (diff) | |
download | mpv-66db9ec7d6a9f869dc922ad9a9b8a5d278577bab.tar.bz2 mpv-66db9ec7d6a9f869dc922ad9a9b8a5d278577bab.tar.xz |
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.
-rw-r--r-- | input/input.c | 3 | ||||
-rw-r--r-- | mp_core.h | 1 | ||||
-rw-r--r-- | mplayer.c | 22 |
3 files changed, 12 insertions, 14 deletions
diff --git a/input/input.c b/input/input.c index 8f5951613a..3d898aa0af 100644 --- a/input/input.c +++ b/input/input.c @@ -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; @@ -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 @@ -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"; |