sync with upstream/cspot

This commit is contained in:
philippe44
2023-11-21 12:52:55 -08:00
parent 807a0e547a
commit 5c90086bbd
3 changed files with 16 additions and 13 deletions

View File

@@ -5,6 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#include <mutex>
#if __has_include("avahi-client/client.h") #if __has_include("avahi-client/client.h")
#include <avahi-client/client.h> #include <avahi-client/client.h>

View File

@@ -201,14 +201,16 @@ void SpircHandler::handleFrame(std::vector<uint8_t>& data) {
break; break;
} }
case MessageType_kMessageTypeReplace: { case MessageType_kMessageTypeReplace: {
CSPOT_LOG(debug, "Got replace frame %d", playbackState->remoteTracks.size()); CSPOT_LOG(debug, "Got replace frame %d",
playbackState->remoteTracks.size());
playbackState->syncWithRemote(); playbackState->syncWithRemote();
// 1st track is the current one, but update the position // 1st track is the current one, but update the position
bool cleared = trackQueue->updateTracks( bool cleared = trackQueue->updateTracks(
playbackState->remoteFrame.state.position_ms + playbackState->remoteFrame.state.position_ms +
ctx->timeProvider->getSyncedTimestamp() - ctx->timeProvider->getSyncedTimestamp() -
playbackState->innerFrame.state.position_measured_at); playbackState->innerFrame.state.position_measured_at,
false);
this->notify(); this->notify();