diff options
-rw-r--r-- | src/c_mpdview.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/c_mpdview.c b/src/c_mpdview.c index eea0f8c..9456e7b 100644 --- a/src/c_mpdview.c +++ b/src/c_mpdview.c @@ -45,6 +45,7 @@ * This is the entrypoint of the program. */ +#include <mpd/idle.h> #include <sys/param.h> #include <sys/syslimits.h> @@ -177,8 +178,9 @@ main char* const argv[]) { struct mpdview_s* view; - bool_t verbose; char c; + bool_t doexit; + bool_t verbose; verbose = FALSE; while ((c = getopt(argc, argv, OPTSTRING)) != -1) { @@ -203,6 +205,12 @@ main if (view == NULL) { return (EXIT_FAILURE); } + doexit = FALSE; + while ( + doexit == FALSE && + mpd_run_idle_mask(view->conn, MPD_IDLE_PLAYER) != 0 + ) { + } c_get_music_dir(view); if (c_connect_mpd(view) != RET_OK) { c_destroy_mpdview(&view); |