diff options
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r-- | src/DabMod.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp index d29b489..4961910 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -36,6 +36,7 @@ #include "InputMemory.h" #include "OutputFile.h" #include "FormatConverter.h" +#include "FrameMultiplexer.h" #include "output/SDR.h" #include "output/UHD.h" #include "output/Soapy.h" @@ -61,13 +62,6 @@ # include <netinet/in.h> #endif -#if HAVE_DECL__MM_MALLOC -# include <mm_malloc.h> -#else -# define memalign(a, b) malloc(b) -#endif - - /* UHD requires the input I and Q samples to be in the interval * [-1.0,1.0], otherwise they get truncated, which creates very * wide-spectrum spikes. Depending on the Transmission Mode, the @@ -203,6 +197,10 @@ static shared_ptr<ModOutput> prepare_output( output = make_shared<OutputFile>(s.outputName); } + else { + throw runtime_error("File output format " + s.fileOutputFormat + + " not known"); + } } #if defined(HAVE_OUTPUT_UHD) else if (s.useUHDOutput) { @@ -451,7 +449,7 @@ int launch_modulator(int argc, char* argv[]) } } #if defined(HAVE_ZEROMQ) - else if (auto in = dynamic_pointer_cast<InputZeroMQReader>(inputReader)) { + else if (dynamic_pointer_cast<InputZeroMQReader>(inputReader)) { run_again = true; // Create a new input reader auto inputZeroMQReader = make_shared<InputZeroMQReader>(); @@ -459,7 +457,8 @@ int launch_modulator(int argc, char* argv[]) inputReader = inputZeroMQReader; } #endif - else if (auto in = dynamic_pointer_cast<InputTcpReader>(inputReader)) { + else if (dynamic_pointer_cast<InputTcpReader>(inputReader)) { + // Create a new input reader auto inputTcpReader = make_shared<InputTcpReader>(); inputTcpReader->Open(mod_settings.inputName); inputReader = inputTcpReader; @@ -535,17 +534,19 @@ run_modulator_state_t run_modulator(modulator_data& m) running = 0; ret = run_modulator_state_t::normal_end; } - } catch (zmq_input_overflow& e) { + } + catch (const zmq_input_overflow& e) { // The ZeroMQ input has overflowed its buffer etiLog.level(warn) << e.what(); ret = run_modulator_state_t::again; - } catch (std::out_of_range& e) { - // One of the DSP blocks has detected an invalid change - // or value in some settings. This can be due to a multiplex - // reconfiguration. + } + catch (const FrameMultiplexerError& e) { + // The FrameMultiplexer saw an error or a change in the size of a + // subchannel. This can be due to a multiplex reconfiguration. etiLog.level(warn) << e.what(); ret = run_modulator_state_t::reconfigure; - } catch (std::exception& e) { + } + catch (const std::exception& e) { etiLog.level(error) << "Exception caught: " << e.what(); ret = run_modulator_state_t::failure; } |