diff --git a/src/inputs/librespot-c/src/connection.c b/src/inputs/librespot-c/src/connection.c index ae922d0c..4ad88a2e 100644 --- a/src/inputs/librespot-c/src/connection.c +++ b/src/inputs/librespot-c/src/connection.c @@ -1,3 +1,5 @@ +#define _GNU_SOURCE // For asprintf and vasprintf + #include #include #include @@ -608,7 +610,7 @@ resolve_server_info_set(struct sp_server *server, const char *key, json_object * RETURN_ERROR(SP_ERR_NOCONNECTION, "Unexpected data in response from access point resolver"); s = json_object_get_string(instance); // This string includes the port - is_same = (server->address && strncmp(s, server->address, strlen(server->address) == 0)); + is_same = server->address && (strncmp(s, server->address, strlen(server->address)) == 0); if (is_same && has_failed) s = NULL; // This AP has failed on us recently, so avoid diff --git a/src/inputs/librespot-c/src/http.c b/src/inputs/librespot-c/src/http.c index a9b155ef..39bae6e7 100644 --- a/src/inputs/librespot-c/src/http.c +++ b/src/inputs/librespot-c/src/http.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE // For asprintf and vasprintf #include #include #include diff --git a/src/inputs/librespot-c/src/librespot-c.c b/src/inputs/librespot-c/src/librespot-c.c index fb0d9a01..b116ccc4 100644 --- a/src/inputs/librespot-c/src/librespot-c.c +++ b/src/inputs/librespot-c/src/librespot-c.c @@ -267,6 +267,12 @@ session_retry(struct sp_session *session) ap_disconnect(&session->conn); + // If we were doing something other than login, queue that + if (session->request->seq_type != SP_SEQ_LOGIN) + seq_next_set(session, session->request->seq_type); + + // Trigger login on a new server + session->request = seq_request_get(SP_SEQ_LOGIN, 0, session->use_legacy); sequence_continue(session); }