Fixed error check of rtp_mcast_base and sap_mcast_addr parameters.

The problem was preventing the possibility to change the values from the defaults of these two parameters.
This commit is contained in:
Andrea Bondavalli 2020-03-30 18:55:10 +02:00
parent 3c295a3c96
commit 3947b77d7c

View File

@ -67,11 +67,11 @@ std::shared_ptr<Config> Config::parse(const std::string& filename) {
config.sample_rate_ = 44100; config.sample_rate_ = 44100;
boost::system::error_code ec; boost::system::error_code ec;
ip::address_v4::from_string(config.rtp_mcast_base_.c_str(), ec); ip::address_v4::from_string(config.rtp_mcast_base_.c_str(), ec);
if (!ec) { if (ec) {
config.rtp_mcast_base_ = "239.1.0.1"; config.rtp_mcast_base_ = "239.1.0.1";
} }
ip::address_v4::from_string(config.sap_mcast_addr_.c_str(), ec); ip::address_v4::from_string(config.sap_mcast_addr_.c_str(), ec);
if (!ec) { if (ec) {
config.sap_mcast_addr_ = "224.2.127.254"; config.sap_mcast_addr_ = "224.2.127.254";
} }
if (config.ptp_domain_ > 127) if (config.ptp_domain_ > 127)