mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-07 21:31:42 +02:00
Allow buidling server without Ogg support
Allow to build an Ogg-less snapserver: ``` 0x00000001 (NEEDED) Shared library: [libjsonrpcpp.so] 0x00000001 (NEEDED) Shared library: [libFLAC.so.8] 0x00000001 (NEEDED) Shared library: [libavahi-common.so.3] 0x00000001 (NEEDED) Shared library: [libavahi-client.so.3] 0x00000001 (NEEDED) Shared library: [libstdc++.so.6] 0x00000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x00000001 (NEEDED) Shared library: [libc.so] ```
This commit is contained in:
parent
f28018ada7
commit
a5ffa356fe
1 changed files with 7 additions and 3 deletions
|
@ -18,7 +18,9 @@
|
||||||
|
|
||||||
#include "encoderFactory.h"
|
#include "encoderFactory.h"
|
||||||
#include "pcmEncoder.h"
|
#include "pcmEncoder.h"
|
||||||
|
#if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBIS_ENC)
|
||||||
#include "oggEncoder.h"
|
#include "oggEncoder.h"
|
||||||
|
#endif
|
||||||
#include "flacEncoder.h"
|
#include "flacEncoder.h"
|
||||||
#include "common/utils/string_utils.h"
|
#include "common/utils/string_utils.h"
|
||||||
#include "common/snapException.h"
|
#include "common/snapException.h"
|
||||||
|
@ -38,10 +40,12 @@ Encoder* EncoderFactory::createEncoder(const std::string& codecSettings) const
|
||||||
codecOptions = utils::string::trim_copy(codec.substr(codec.find(":") + 1));
|
codecOptions = utils::string::trim_copy(codec.substr(codec.find(":") + 1));
|
||||||
codec = utils::string::trim_copy(codec.substr(0, codec.find(":")));
|
codec = utils::string::trim_copy(codec.substr(0, codec.find(":")));
|
||||||
}
|
}
|
||||||
if (codec == "ogg")
|
if (codec == "pcm")
|
||||||
encoder = new OggEncoder(codecOptions);
|
|
||||||
else if (codec == "pcm")
|
|
||||||
encoder = new PcmEncoder(codecOptions);
|
encoder = new PcmEncoder(codecOptions);
|
||||||
|
#if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBIS_ENC)
|
||||||
|
else if (codec == "ogg")
|
||||||
|
encoder = new OggEncoder(codecOptions);
|
||||||
|
#endif
|
||||||
else if (codec == "flac")
|
else if (codec == "flac")
|
||||||
encoder = new FlacEncoder(codecOptions);
|
encoder = new FlacEncoder(codecOptions);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue