summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5ecaff)
raw | patch | inline | side by side (parent: f5ecaff)
| author | Max Kellermann <max.kellermann@gmail.com> | |
| Fri, 17 Mar 2017 17:01:38 +0000 (18:01 +0100) | ||
| committer | Max Kellermann <max.kellermann@gmail.com> | |
| Fri, 17 Mar 2017 17:01:38 +0000 (18:01 +0100) |
ncmpc has been requiring MPD 0.14+ for 7 years (commit e25d7523), and
we really don't need the timer fallback. "idle" just has to be
supported.
we really don't need the timer fallback. "idle" just has to be
supported.
| src/main.c | patch | blob | history | |
| src/mpdclient.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 76fe2354a4c0bc6f0b02c7e3de26948144d8853f..53b3d893866f5e3c82b6c7e44767c6bbe2a8862f 100644 (file)
--- a/src/main.c
+++ b/src/main.c
should_enable_update_timer(void)
{
return (mpdclient_is_connected(mpd) &&
- (mpd->source == NULL || /* "idle" not supported */
- (mpd->status != NULL &&
- mpd_status_get_state(mpd->status) == MPD_STATE_PLAY)))
+ mpd->status != NULL &&
+ mpd_status_get_state(mpd->status) == MPD_STATE_PLAY)
#ifndef NCMPC_MINI
|| options.display_time
#endif
do_mpd_update(void)
{
if (mpdclient_is_connected(mpd) &&
- (mpd->source == NULL || mpd->events != 0 ||
+ (mpd->events != 0 ||
(mpd->status != NULL &&
mpd_status_get_state(mpd->status) == MPD_STATE_PLAY)))
mpdclient_update(mpd);
* idle event (or when the connection dies).
*/
static void
-idle_callback(enum mpd_error error, enum mpd_server_error server_error,
+idle_callback(enum mpd_error error,
+ gcc_unused enum mpd_server_error server_error,
const char *message, enum mpd_idle events,
void *ctx)
{
assert(mpdclient_is_connected(c));
if (error != MPD_ERROR_SUCCESS) {
- if (error == MPD_ERROR_SERVER &&
- server_error == MPD_SERVER_ERROR_UNKNOWN_CMD) {
- /* the "idle" command is not supported - fall
- back to timer based polling */
- mpd_glib_free(c->source);
- c->source = NULL;
- auto_update_timer();
- return;
- }
-
char *allocated;
if (error == MPD_ERROR_SERVER)
message = allocated = utf8_to_locale(message);
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 6826043dbf4a2665773c09a14e4d2b2d2e473c70..164a08dd927e40b121072929610ef875125c9c1d 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
if (connection == NULL)
return false;
- /* always announce these options as long as we don't have
- "idle" support */
- if (c->source == NULL)
- c->events |= MPD_IDLE_PLAYER|MPD_IDLE_OPTIONS;
-
/* free the old status */
if (c->status)
mpd_status_free(c->status);
if (c->status == NULL)
return mpdclient_handle_error(c);
- if (c->source == NULL &&
- c->update_id != mpd_status_get_update_id(c->status)) {
- c->events |= MPD_IDLE_UPDATE;
-
- if (c->update_id > 0)
- c->events |= MPD_IDLE_DATABASE;
- }
-
c->update_id = mpd_status_get_update_id(c->status);
- if (c->source == NULL &&
- c->volume != mpd_status_get_volume(c->status))
- c->events |= MPD_IDLE_MIXER;
-
c->volume = mpd_status_get_volume(c->status);
/* 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_QUEUE;
-
if (!playlist_is_empty(&c->playlist))
retval = mpdclient_playlist_update_changes(c);
else