mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-01 18:31:45 +02:00
Small time sync fix
This commit is contained in:
parent
d82c3c42ae
commit
83ab1cb260
2 changed files with 3 additions and 4 deletions
|
@ -628,9 +628,8 @@ void StreamServer::onMessageReceived(StreamSession* streamSession, const msg::Ba
|
|||
timeMsg->deserialize(baseMessage, buffer);
|
||||
timeMsg->refersTo = timeMsg->id;
|
||||
timeMsg->latency = timeMsg->received - timeMsg->sent;
|
||||
// LOG(INFO) << "Latency sec: " << timeMsg.latency.sec << ", usec: " << timeMsg.latency.usec << ", refers to: " << timeMsg.refersTo <<
|
||||
//"\n";
|
||||
streamSession->sendAsync(timeMsg, true);
|
||||
// LOG(INFO) << "Latency sec: " << timeMsg.latency.sec << ", usec: " << timeMsg.latency.usec << ", refers to: " << timeMsg.refersTo << "\n";
|
||||
streamSession->sendAsync(timeMsg);
|
||||
|
||||
// refresh streamSession state
|
||||
ClientInfoPtr client = Config::instance().getClientInfo(streamSession->clientId);
|
||||
|
|
|
@ -166,8 +166,8 @@ void StreamSession::sendAsync(msg::message_ptr message, bool send_now)
|
|||
if (!message)
|
||||
return;
|
||||
|
||||
// sendAsync(shared_const_buffer(*message), send_now);
|
||||
tv t;
|
||||
// TODO: better set the timestamp in send_next for more accurate time sync
|
||||
message->sent = t;
|
||||
std::ostringstream oss;
|
||||
message->serialize(oss);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue