Code

options: configurable timeout for MPD connections
[ncmpc.git] / src / options.c
index 47fc3b9715e72829758d811642b426bac4d7012b..1b3e9af09cbfb31e7edf7e79ef41d39094214c92 100644 (file)
@@ -60,6 +60,7 @@ options_t options = {
        .audible_bell = true,
        .bell_on_wrap = true,
        .status_message_time = 3,
+       .timeout_ms = DEFAULT_MPD_TIMEOUT,
 #ifndef NCMPC_MINI
        .scroll = DEFAULT_SCROLL,
        .welcome_screen_list = true,
@@ -374,6 +375,9 @@ options_init(void)
 #ifndef NCMPC_MINI
        options.scroll_sep = g_strdup(DEFAULT_SCROLL_SEP);
 #endif
+       if (getenv("MPD_TIMEOUT") != NULL)
+               /* let libmpdclient parse the environment variable */
+               options.timeout_ms = 0;
 }
 
 void