Small cleanup

This commit is contained in:
Lars Immisch
2024-04-26 16:41:09 +01:00
parent 2a8f2a6699
commit 5a4111dd8c

View File

@@ -124,7 +124,6 @@ class Loopback(object):
size, data = self.capture.read()
if size:
logging.warning(f'initial data discarded ({size} bytes)')
# self.queue.append(data)
self.state = LoopbackState.LISTENING
@@ -186,8 +185,12 @@ class Loopback(object):
def handle_capture_event(self, eventmask, name):
if eventmask & select.POLLERR == select.POLLERR:
# This is typically an underrun caused by the external command being run synchronously
# (on the same thread)
logging.warning(f'POLLERR for capture device: {state_names[self.capture.state()]}')
self.capture.drop()
self.capture.read()
return False
'''called when data is available for reading'''
self.last_capture_event = datetime.now()