diff --git a/client/Makefile b/client/Makefile index e36a5c0a..e946f1d3 100644 --- a/client/Makefile +++ b/client/Makefile @@ -51,20 +51,20 @@ ifeq ($(TARGET), ANDROID) CXX = $(NDK_DIR)/bin/arm-linux-androideabi-g++ STRIP = $(NDK_DIR)/bin/arm-linux-androideabi-strip -CXXFLAGS += -pthread -DANDROID -DNO_CPP11_STRING -fPIC -DHAS_OGG -DHAS_TREMOR -DHAS_OPENSL -I$(NDK_DIR)/include +CXXFLAGS += -pthread -DANDROID -DNO_CPP11_STRING -fPIC -DHAS_OGG -DHAS_TREMOR -DHAS_FLAC -DHAS_OPENSL -I$(NDK_DIR)/include LDFLAGS = -L$(NDK_DIR)/lib -pie -lvorbisidec -logg -lFLAC -lOpenSLES OBJ += player/openslPlayer.o else ifeq ($(TARGET), OPENWRT) STRIP = echo -CXXFLAGS += -pthread -DNO_CPP11_STRING -DHAS_OGG -DHAS_TREMOR -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON +CXXFLAGS += -pthread -DNO_CPP11_STRING -DHAS_OGG -DHAS_TREMOR -DHAS_FLAC -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON LDFLAGS = -lasound -lvorbisidec -logg -lFLAC -lavahi-client -lavahi-common -latomic OBJ += player/alsaPlayer.o browseZeroConf/browseAvahi.o else ifeq ($(TARGET), BUILDROOT) -CXXFLAGS += -pthread -DNO_CPP11_STRING -DHAS_OGG -DHAS_TREMOR -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON +CXXFLAGS += -pthread -DNO_CPP11_STRING -DHAS_OGG -DHAS_TREMOR -DHAS_FLAC -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON LDFLAGS += -lasound -lvorbisidec -logg -lFLAC -lavahi-client -lavahi-common -latomic OBJ += player/alsaPlayer.o browseZeroConf/browseAvahi.o @@ -73,6 +73,7 @@ else ifeq ($(TARGET), MACOS) CXX = g++ STRIP = strip CXXFLAGS += -DHAS_OGG -DHAS_VORBIS -DHAS_COREAUDIO -DFREEBSD -DMACOS -DHAS_BONJOUR -DHAS_DAEMON -I/usr/local/include -Wno-unused-local-typedef -Wno-deprecated +CXXFLAGS += -DHAS_OGG -DHAS_VORBIS -DHAS_FLAC -DHAS_COREAUDIO -DFREEBSD -DMACOS -DHAS_BONJOUR -DHAS_DAEMON -I/usr/local/include -Wno-unused-local-typedef -Wno-deprecated LDFLAGS = -logg -lvorbis -lFLAC -L/usr/local/lib -framework AudioToolbox -framework CoreFoundation OBJ += player/coreAudioPlayer.o browseZeroConf/browseBonjour.o @@ -80,7 +81,7 @@ else CXX = g++ STRIP = strip -CXXFLAGS += -pthread -DHAS_OGG -DHAS_VORBIS -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON +CXXFLAGS += -pthread -DHAS_OGG -DHAS_VORBIS -DHAS_FLAC -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON LDFLAGS = -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++ OBJ += player/alsaPlayer.o browseZeroConf/browseAvahi.o diff --git a/client/controller.cpp b/client/controller.cpp index 74f7a013..39c86035 100644 --- a/client/controller.cpp +++ b/client/controller.cpp @@ -20,11 +20,13 @@ #include #include #include "controller.h" +#include "decoder/pcmDecoder.h" #if defined(HAS_OGG) && (defined(HAS_TREMOR) || defined(HAS_VORBIS)) #include "decoder/oggDecoder.h" #endif -#include "decoder/pcmDecoder.h" +#if defined(HAS_FLAC) #include "decoder/flacDecoder.h" +#endif #include "timeProvider.h" #include "message/time.h" #include "message/hello.h" @@ -110,8 +112,10 @@ void Controller::onMessageReceived(ClientConnection* connection, const msg::Base else if (headerChunk_->codec == "ogg") decoder_.reset(new OggDecoder()); #endif +#if defined(HAS_FLAC) else if (headerChunk_->codec == "flac") decoder_.reset(new FlacDecoder()); +#endif else throw SnapException("codec not supported: \"" + headerChunk_->codec + "\""); diff --git a/server/encoder/encoderFactory.cpp b/server/encoder/encoderFactory.cpp index 53ab7c9c..f1f6f11a 100644 --- a/server/encoder/encoderFactory.cpp +++ b/server/encoder/encoderFactory.cpp @@ -21,6 +21,7 @@ #if defined(HAS_OGG) && defined(HAS_VORBIS) && defined(HAS_VORBIS_ENC) #include "oggEncoder.h" #endif +#if defined(HAS_FLAC) #include "flacEncoder.h" #include "common/utils/string_utils.h" #include "common/snapException.h" @@ -46,8 +47,10 @@ Encoder* EncoderFactory::createEncoder(const std::string& codecSettings) const else if (codec == "ogg") encoder = new OggEncoder(codecOptions); #endif +#if defined(HAS_FLAC) else if (codec == "flac") encoder = new FlacEncoder(codecOptions); +#endif else { throw SnapException("unknown codec: " + codec);