cspot fixes backport

This commit is contained in:
philippe44
2023-10-23 17:09:50 -07:00
parent 9ebe717e74
commit ca38a14420
3 changed files with 28 additions and 14 deletions

View File

@@ -204,8 +204,13 @@ void SpircHandler::handleFrame(std::vector<uint8_t>& data) {
CSPOT_LOG(debug, "Got replace frame");
playbackState->syncWithRemote();
trackQueue->updateTracks(playbackState->remoteFrame.state.position_ms,
false);
// 1st track is the current one, but update the position
trackQueue->updateTracks(
playbackState->remoteFrame.state.position_ms +
ctx->timeProvider->getSyncedTimestamp() -
playbackState->innerFrame.state.position_measured_at,
false);
this->notify();
sendEvent(EventType::FLUSH);