git-svn-id: svn://elaine/murooma/trunk@311 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-10-29 21:12:03 +00:00
parent 5e9eebd7a7
commit 8710e5e898
4 changed files with 18 additions and 9 deletions

View file

@ -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();