diff --git a/main.c b/main.c index 3a32a10..461f065 100644 --- a/main.c +++ b/main.c @@ -83,12 +83,11 @@ case ONOFF_PIN: if (playing) { success = mpd_run_stop(conn); - playing = false; + printf("stop %d\n", success); } else { success = mpd_run_play(conn); - playing = true; + printf("start %d\n", success); } - printf("on/off %d\n", success); if (success) { playing = !playing; } @@ -120,7 +119,8 @@ case MPD_ERROR_STATE: case MPD_ERROR_MALFORMED: mpd_connection_clear_error(conn); - printf("Clear error, try again.\n"); + printf("Clear error, don't try again.\n"); + success = true; break; case MPD_ERROR_TIMEOUT: case MPD_ERROR_CLOSED: