forked from DRMTalks/devine
Fix rare issue where DASH/HLS dl speed divides by 0
This commit is contained in:
parent
1c73e8d7fa
commit
71cf2b4016
|
@ -568,7 +568,7 @@ class DASH:
|
||||||
|
|
||||||
if download_sizes and (time_since > 5 or finished_threads == len(segments)):
|
if download_sizes and (time_since > 5 or finished_threads == len(segments)):
|
||||||
data_size = sum(download_sizes)
|
data_size = sum(download_sizes)
|
||||||
download_speed = data_size / time_since
|
download_speed = data_size / (time_since or 1)
|
||||||
progress(downloaded=f"DASH {filesize.decimal(download_speed)}/s")
|
progress(downloaded=f"DASH {filesize.decimal(download_speed)}/s")
|
||||||
last_speed_refresh = now
|
last_speed_refresh = now
|
||||||
download_sizes.clear()
|
download_sizes.clear()
|
||||||
|
|
|
@ -413,7 +413,7 @@ class HLS:
|
||||||
|
|
||||||
if download_sizes and (time_since > 5 or finished_threads == len(master.segments)):
|
if download_sizes and (time_since > 5 or finished_threads == len(master.segments)):
|
||||||
data_size = sum(download_sizes)
|
data_size = sum(download_sizes)
|
||||||
download_speed = data_size / time_since
|
download_speed = data_size / (time_since or 1)
|
||||||
progress(downloaded=f"HLS {filesize.decimal(download_speed)}/s")
|
progress(downloaded=f"HLS {filesize.decimal(download_speed)}/s")
|
||||||
last_speed_refresh = now
|
last_speed_refresh = now
|
||||||
download_sizes.clear()
|
download_sizes.clear()
|
||||||
|
|
Loading…
Reference in New Issue