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:
|
for w in self.writers:
|
||||||
w.start()
|
w.start()
|
||||||
while self.doRun:
|
while self.doRun:
|
||||||
|
data = None
|
||||||
|
try:
|
||||||
data = self.source.read(256)
|
data = self.source.read(256)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
if data is None or (isinstance(data, bytes) and len(data) == 0):
|
if data is None or (isinstance(data, bytes) and len(data) == 0):
|
||||||
self.doRun = False
|
self.doRun = False
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user