WIP opus is working, some values are hard coded

This commit is contained in:
badaix 2019-11-02 13:19:55 +01:00
parent 8d47371115
commit 258bab4f65
6 changed files with 95 additions and 84 deletions

View file

@ -62,7 +62,7 @@ void Controller::onMessageReceived(ClientConnection* /*connection*/, const msg::
{
auto* pcmChunk = new msg::PcmChunk(sampleFormat_, 0);
pcmChunk->deserialize(baseMessage, buffer);
// LOG(DEBUG) << "chunk: " << pcmChunk->payloadSize << ", sampleFormat: " << sampleFormat_.rate << "\n";
// LOG(DEBUG) << "chunk: " << pcmChunk->payloadSize << ", sampleFormat: " << sampleFormat_.rate << "\n";
if (decoder_->decode(pcmChunk))
{
// TODO: do decoding in thread?
@ -115,7 +115,7 @@ void Controller::onMessageReceived(ClientConnection* /*connection*/, const msg::
#endif
#if defined(HAS_OPUS)
else if (headerChunk_->codec == "opus")
decoder_.reset(new OpusDecoderWrapper());
decoder_.reset(new OpusDecoder());
#endif
else
throw SnapException("codec not supported: \"" + headerChunk_->codec + "\"");