merge PR#4

This commit is contained in:
badaix 2019-11-01 23:07:32 +01:00
commit 0c7691756c
10 changed files with 235 additions and 7 deletions

View file

@ -27,6 +27,9 @@
#if defined(HAS_FLAC)
#include "decoder/flac_decoder.hpp"
#endif
#if defined(HAS_OPUS)
#include "decoder/opus_decoder.hpp"
#endif
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
#include "message/hello.hpp"
@ -109,6 +112,10 @@ void Controller::onMessageReceived(ClientConnection* /*connection*/, const msg::
#if defined(HAS_FLAC)
else if (headerChunk_->codec == "flac")
decoder_.reset(new FlacDecoder());
#endif
#if defined(HAS_OPUS)
else if (headerChunk_->codec == "opus")
decoder_.reset(new OpusDecoderWrapper());
#endif
else
throw SnapException("codec not supported: \"" + headerChunk_->codec + "\"");