From: Hugo Villeneuve Date: Tue, 31 Mar 2026 18:55:46 +0000 (-0400) Subject: Monitor state changes X-Git-Url: http://gitweb.hugovil.com/sitemap.xml?a=commitdiff_plain;h=1119c5df38c9aaa27165a8d68c199c6b6fa1f711;p=mpdstream Monitor state changes Signed-off-by: Hugo Villeneuve --- 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: