protect against erroneous reads
This commit is contained in:
parent
0518ff9358
commit
645ace75c3
@ -247,7 +247,11 @@ class AudioChopper(threading.Thread, metaclass=ABCMeta):
|
||||
for w in self.writers:
|
||||
w.start()
|
||||
while self.doRun:
|
||||
data = None
|
||||
try:
|
||||
data = self.source.read(256)
|
||||
except ValueError:
|
||||
pass
|
||||
if data is None or (isinstance(data, bytes) and len(data) == 0):
|
||||
self.doRun = False
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user