"[%s] child player aborted stream: %s", self.player_id, child_player_id
)
self.connected_clients.pop(child_player_id, None)
- sox_proc.terminate()
await sox_proc.communicate()
- await sox_proc.wait()
+ sox_proc.terminate()
+ if sox_proc and sox_proc.returncode is None:
+ await sox_proc.wait()
else:
self.connected_clients.pop(child_player_id, None)
LOGGER.debug(
)
if fill_buffer_task and not fill_buffer_task.cancelled():
fill_buffer_task.cancel()
- sox_proc.terminate()
await sox_proc.communicate()
- await sox_proc.wait()
- # raise GeneratorExit from exc
+ sox_proc.terminate()
+ if sox_proc and sox_proc.returncode is None:
+ await sox_proc.wait()
else:
LOGGER.debug(
"[async_get_sox_stream] [%s/%s] finished",
LOGGER.debug("[async_queue_stream_flac] [%s] aborted", player_id)
if fill_buffer_task and not fill_buffer_task.cancelled():
fill_buffer_task.cancel()
- sox_proc.terminate()
await sox_proc.communicate()
- await sox_proc.wait()
+ sox_proc.terminate()
+ if sox_proc and sox_proc.returncode is None:
+ await sox_proc.wait()
else:
LOGGER.debug(
"[async_queue_stream_flac] [%s] finished",
str(exc),
)
# read remaining bytes
- process.terminate()
await process.communicate()
- await process.wait()
+ process.terminate()
+ if process and process.returncode is None:
+ await process.wait()
# signal end of stream event
self.mass.signal_event(EVENT_STREAM_ENDED, streamdetails)