summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5acc319)
raw | patch | inline | side by side (parent: 5acc319)
author | Max Kellermann <max@duempel.org> | |
Fri, 23 Oct 2009 09:01:52 +0000 (11:01 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 23 Oct 2009 09:01:52 +0000 (11:01 +0200) |
In each of the functions, the client may get disconnected, and we have
to check c->status!=NULL again.
to check c->status!=NULL again.
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index bffbce80eebc51d2115567358e1462c040c34378..3bc6f0760211e6cfca4014750015200d739090a1 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
mpdclient_update(struct mpdclient *c)
{
struct mpd_connection *connection = mpdclient_get_connection(c);
- bool retval;
c->volume = -1;
/* check if the playlist needs an update */
if (c->playlist.version != mpd_status_get_queue_version(c->status)) {
+ bool retval;
+
if (c->source == NULL)
c->events |= MPD_IDLE_PLAYLIST;
retval = mpdclient_playlist_update_changes(c);
else
retval = mpdclient_playlist_update(c);
- } else
- retval = true;
+ if (!retval)
+ return false;
+ }
/* update the current song */
if (!c->song || mpd_status_get_song_id(c->status)) {
mpd_status_get_song_pos(c->status));
}
- return retval;
+ return true;
}
struct mpd_connection *