recv: fix division by 0 error

This commit is contained in:
Roman Zeyde
2014-09-21 17:11:22 +03:00
parent b0ff515c7e
commit b678c0dc57

View File

@@ -241,7 +241,7 @@ class Receiver(object):
audio_time = self.stats['rx_bits'] / float(modem.modem_bps)
log.debug('Demodulated %.3f kB @ %.3f seconds (%.1f%% realtime)',
self.stats['rx_bits'] / 8e3, duration,
100 * duration / audio_time)
100 * duration / audio_time if audio_time else 0)
log.info('Received %.3f kB @ %.3f seconds = %.3f kB/s',
self.size * 1e-3, duration, self.size * 1e-3 / duration)