summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f401cc)
raw | patch | inline | side by side (parent: 6f401cc)
author | Max Kellermann <max@duempel.org> | |
Fri, 2 Oct 2009 07:19:09 +0000 (09:19 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 2 Oct 2009 07:19:09 +0000 (09:19 +0200) |
.. instead of accessing mpdclient.connection directly.
diff --git a/src/mpdclient.c b/src/mpdclient.c
index fd223d6f80ea5b9a5834bfd58277cf0f368f9111..9a9154caafb4f57de45d462dc7db54218a140af2 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
static bool
MPD_ERROR(const struct mpdclient *client)
{
- return client->connection == NULL ||
+ return !mpdclient_is_connected(client) ||
mpd_connection_get_error(client->connection) != MPD_ERROR_SUCCESS;
}
diff --git a/src/player_command.c b/src/player_command.c
index 507e697b82ffab61e1884639bb7b505696d57a76..337d7677d6d7334fc4453be4bf05b691614f9457 100644 (file)
--- a/src/player_command.c
+++ b/src/player_command.c
if (seek_id < 0)
return;
+ if (!mpdclient_is_connected(c)) {
+ seek_id = -1;
+ return;
+ }
+
if (c->song != NULL && (unsigned)seek_id == mpd_song_get_id(c->song))
if (!mpd_run_seek_id(c->connection, seek_id, seek_target_time))
mpdclient_handle_error(c);
{
const struct mpd_song *song;
- if (c->connection == NULL || c->status == NULL)
+ if (!mpdclient_is_connected(c) || c->status == NULL)
return false;
cancel_seek_timer();
diff --git a/src/screen_client.c b/src/screen_client.c
index 2d39a29a591f29d47b1b5c9d0f133223604f7050..9d60ed2cd6943cbd018653fdcc0bc4338d53ffc9 100644 (file)
--- a/src/screen_client.c
+++ b/src/screen_client.c
unsigned id;
assert(c != NULL);
- assert(c->connection != NULL);
+ assert(mpdclient_is_connected(c));
id = mpd_run_update(c->connection, path);
if (id == 0) {
diff --git a/src/screen_outputs.c b/src/screen_outputs.c
index cd3a4435a9148aa664534a5ea7cb37504c7bf63b..1d60bae6feedf2cc66213315d1879018f5b0a884 100644 (file)
--- a/src/screen_outputs.c
+++ b/src/screen_outputs.c
assert(mpd_outputs != NULL);
- if (c->connection == NULL)
+ if (!mpdclient_is_connected(c))
return;
mpd_send_outputs(c->connection);
diff --git a/src/screen_search.c b/src/screen_search.c
index 5434738660830b3ddd6e29221cb71b95c53c8ed3..3829f8dfa1bcbbd3d037265db62906c4058cd6f7 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
static void
search_new(struct mpdclient *c)
{
- if (c->connection == NULL)
+ if (!mpdclient_is_connected(c))
return;
search_clear(true);