mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-09 15:16:42 +02:00
latency
git-svn-id: svn://elaine/murooma/trunk@311 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
5e9eebd7a7
commit
8710e5e898
4 changed files with 18 additions and 9 deletions
|
@ -48,10 +48,11 @@ void Controller::onMessageReceived(ClientConnection* connection, const BaseMessa
|
|||
}
|
||||
|
||||
|
||||
void Controller::start(const PcmDevice& pcmDevice, const std::string& _ip, size_t _port)
|
||||
void Controller::start(const PcmDevice& pcmDevice, const std::string& _ip, size_t _port, size_t latency)
|
||||
{
|
||||
ip = _ip;
|
||||
pcmDevice_ = pcmDevice;
|
||||
latency_ = latency;
|
||||
clientConnection = new ClientConnection(this, ip, _port);
|
||||
controllerThread = new thread(&Controller::worker, this);
|
||||
}
|
||||
|
@ -107,7 +108,7 @@ void Controller::worker()
|
|||
cout << "diff to server [ms]: " << TimeProvider::getInstance().getDiffToServer<chronos::msec>().count() << "\n";
|
||||
|
||||
stream = new Stream(*sampleFormat);
|
||||
stream->setBufferLen(serverSettings->bufferMs);
|
||||
stream->setBufferLen(serverSettings->bufferMs - latency_);
|
||||
|
||||
Player player(pcmDevice_, stream);
|
||||
player.start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue