diff --git a/components/spotify/cspot/src/MercurySession.cpp b/components/spotify/cspot/src/MercurySession.cpp index ee084466..164a6dd4 100644 --- a/components/spotify/cspot/src/MercurySession.cpp +++ b/components/spotify/cspot/src/MercurySession.cpp @@ -120,9 +120,9 @@ void MercurySession::handlePacket() { switch (static_cast(packet.command)) { case RequestType::COUNTRY_CODE_RESPONSE: { this->countryCode = std::string(); - this->countryCode.reserve(2); + this->countryCode.resize(2); memcpy(this->countryCode.data(), packet.data.data(), 2); - CSPOT_LOG(debug, "Received country code"); + CSPOT_LOG(debug, "Received country code %s", this->countryCode.c_str()); break; } case RequestType::AUDIO_KEY_FAILURE_RESPONSE: diff --git a/components/spotify/cspot/src/TrackProvider.cpp b/components/spotify/cspot/src/TrackProvider.cpp index cc77b14b..32abdc82 100644 --- a/components/spotify/cspot/src/TrackProvider.cpp +++ b/components/spotify/cspot/src/TrackProvider.cpp @@ -77,12 +77,11 @@ void TrackProvider::onMetadataResponse(MercurySession::Response& res) { std::vector trackId; std::vector fileId; - AudioFormat format = AudioFormat_OGG_VORBIS_160; - + if (altIndex < 0) { trackId = pbArrayToVector(trackInfo.gid); for (int x = 0; x < trackInfo.file_count; x++) { - if (trackInfo.file[x].format == format) { + if (trackInfo.file[x].format == ctx->config.audioFormat) { fileId = pbArrayToVector(trackInfo.file[x].file_id); break; // If file found stop searching } @@ -90,7 +89,7 @@ void TrackProvider::onMetadataResponse(MercurySession::Response& res) { } else { trackId = pbArrayToVector(trackInfo.alternative[altIndex].gid); for (int x = 0; x < trackInfo.alternative[altIndex].file_count; x++) { - if (trackInfo.alternative[altIndex].file[x].format == format) { + if (trackInfo.alternative[altIndex].file[x].format == ctx->config.audioFormat) { fileId = pbArrayToVector(trackInfo.alternative[altIndex].file[x].file_id); break; // If file found stop searching diff --git a/components/squeezelite/decode_external.c b/components/squeezelite/decode_external.c index 27f90b33..4feecaca 100644 --- a/components/squeezelite/decode_external.c +++ b/components/squeezelite/decode_external.c @@ -123,7 +123,7 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, va_list args) { // don't LOCK_O as there is always a chance that LMS takes control later anyway if (output.external != DECODE_BT && output.state > OUTPUT_STOPPED) { - LOG_WARN("Cannot use BT sink while LMS/AirPlay/CSpot are controlling player"); + LOG_WARN("Cannot use BT sink while LMS/AirPlay/CSpot are controlling player %d", output.external); return false; } @@ -205,7 +205,7 @@ static bool raop_sink_cmd_handler(raop_event_t event, va_list args) { // don't LOCK_O as there is always a chance that LMS takes control later anyway if (output.external != DECODE_RAOP && output.state > OUTPUT_STOPPED) { - LOG_WARN("Cannot use Airplay sink while LMS/BT/CSpot are controlling player"); + LOG_WARN("Cannot use Airplay sink while LMS/BT/CSpot are controlling player %d", output.external); return false; } @@ -338,7 +338,7 @@ static bool cspot_cmd_handler(cspot_event_t cmd, va_list args) { // don't LOCK_O as there is always a chance that LMS takes control later anyway if (output.external != DECODE_CSPOT && output.state > OUTPUT_STOPPED) { - LOG_WARN("Cannot use CSpot sink while LMS/BT/Airplay are controlling player"); + LOG_WARN("Cannot use CSpot sink while LMS/BT/Airplay are controlling player %d", output.external); return false; }