don't use the resampler if the optimization says so

This commit is contained in:
Jakob Ketterl 2019-10-13 18:25:32 +02:00
parent eda556ef03
commit f45857f79b

View File

@ -266,7 +266,12 @@ class ServiceHandler(object):
with self.lock:
self.services = []
for group in self.optimizeResampling(dials, sr):
groups = self.optimizeResampling(dials, sr)
if groups is None:
for dial in dials:
self.services.append(self.setupService(dial["mode"], dial["frequency"], self.source))
else:
for group in groups:
frequencies = sorted([f["frequency"] for f in group])
min = frequencies[0]
max = frequencies[-1]
@ -320,7 +325,10 @@ class ServiceHandler(object):
for r in results:
logger.debug("splits: {0}, total: {1}".format(r["num_splits"], r["total_bandwidth"]))
return results[0]["groups"]
best = results[0]
if best["num_splits"] is None:
return None
return best["groups"]
def setupService(self, mode, frequency, source):
logger.debug("setting up service {0} on frequency {1}".format(mode, frequency))