Skip to content

Commit

Permalink
"replace frame" requires updating position (#161)
Browse files Browse the repository at this point in the history
* replace frame requires updating position

* formatting (...)

* more (enougj) formating
  • Loading branch information
philippe44 authored Nov 19, 2023
1 parent ef4234a commit 34f6436
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cspot/bell
9 changes: 7 additions & 2 deletions cspot/src/SpircHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 34f6436

Please sign in to comment.