diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-11-27 16:27:08 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-11-27 16:27:08 +0100 |
commit | 79a788b6139f121e30816c046f7ff2c4320d5a0b (patch) | |
tree | a39551dec8baa012d617e739ed13066b232c2c81 /src/DabMultiplexer.cpp | |
parent | c43aed07562dc2bd3d2dfd6065df3ce564cf3cfa (diff) | |
download | dabmux-79a788b6139f121e30816c046f7ff2c4320d5a0b.tar.gz dabmux-79a788b6139f121e30816c046f7ff2c4320d5a0b.tar.bz2 dabmux-79a788b6139f121e30816c046f7ff2c4320d5a0b.zip |
Add source and ttl settings for EDI
Diffstat (limited to 'src/DabMultiplexer.cpp')
-rw-r--r-- | src/DabMultiplexer.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp index 5defce7..2b2acd9 100644 --- a/src/DabMultiplexer.cpp +++ b/src/DabMultiplexer.cpp @@ -151,7 +151,25 @@ void DabMultiplexer::set_edi_config(const edi_configuration_t& new_edi_conf) } if (edi_conf.enabled) { - edi_output.create(edi_conf.source_port); + int err = edi_output.create(edi_conf.source_port); + + if (err) { + etiLog.level(error) << "EDI socket creation failed!"; + throw MuxInitException(); + } + + if (not edi_conf.source_addr.empty()) { + err = edi_output.setMulticastSource(edi_conf.source_addr.c_str()); + if (err) { + etiLog.level(error) << "EDI socket set source failed!"; + throw MuxInitException(); + } + err = edi_output.setMulticastTTL(edi_conf.ttl); + if (err) { + etiLog.level(error) << "EDI socket set TTL failed!"; + throw MuxInitException(); + } + } } if (edi_conf.verbose) { |