From 3b39d417a11d9079f1bcbcb1d0f4e72b225c9e9f Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Thu, 25 Mar 2010 00:26:01 +0100 Subject: [PATCH] if connection to mpd is lost, change mpd state to unknown --- src/mpdpp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index e32061a..5d796ad 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -1303,7 +1303,14 @@ int MPD::Connection::CheckForErrors() itsMaxPlaylistLength = 0; } if (!mpd_connection_clear_error(itsConnection)) + { Disconnect(); + // notify about mpd state changed to unknown. + StatusChanges changes; + changes.PlayerState = 1; + if (itsUpdater) + itsUpdater(this, changes, itsErrorHandlerUserdata); + } if (itsErrorHandler) itsErrorHandler(this, error_code, itsErrorMessage.c_str(), itsErrorHandlerUserdata); } -- 2.11.4.GIT