From 1119c5df38c9aaa27165a8d68c199c6b6fa1f711 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Tue, 31 Mar 2026 14:55:46 -0400 Subject: [PATCH] Monitor state changes Signed-off-by: Hugo Villeneuve --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 817c9ba..9e21a5b 100644 --- a/src/main.c +++ b/src/main.c @@ -147,6 +147,7 @@ int mpd_check_abnormal_stop(struct mpd_status *status) int main(int argc, char **argv) { + enum mpd_state last_state; int rc; openlog(PACKAGE_NAME, 0, LOG_USER); @@ -168,6 +169,7 @@ main(int argc, char **argv) is_stream = false; song_id = -1; + last_state = -1; while (true) { struct mpd_status *status; @@ -190,6 +192,8 @@ main(int argc, char **argv) continue; state = mpd_status_get_state(status); + if (state == last_state) + continue; switch (state) { case MPD_STATE_PLAY: -- 2.47.3