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:
Jörg Krause 2017-03-15 12:31:23 +01:00 committed by badaix
parent f28018ada7
commit a5ffa356fe

View file

@ -18,7 +18,9 @@
#include "encoderFactory.h"
#include "pcmEncoder.h"
#if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBIS_ENC)
#include "oggEncoder.h"
#endif
#include "flacEncoder.h"
#include "common/utils/string_utils.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));
codec = utils::string::trim_copy(codec.substr(0, codec.find(":")));
}
if (codec == "ogg")
encoder = new OggEncoder(codecOptions);
else if (codec == "pcm")
if (codec == "pcm")
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")
encoder = new FlacEncoder(codecOptions);
else