tx-rate workaround

This commit is contained in:
Arseniy Kuznetsov
2023-06-30 10:09:48 +01:00
parent cea398dd10
commit bdcf2c985f

View File

@@ -109,7 +109,10 @@ class BaseOutputProcessor:
@staticmethod
def parse_bitrates(rate):
rate = int(rate)
try:
rate = int(rate)
except:
return BaseOutputProcessor.parse_rates(rate)
power = floor(log(rate, 1000))
return f"{int(rate / 1000 ** power)} {['bps', 'Kbps', 'Mbps', 'Gbps'][int(power)]}"