Delete pipe file if it exists

This commit is contained in:
Nick Mowen 2022-12-29 16:20:47 -07:00
parent f2a5b9e650
commit 072861a0a9

View File

@ -39,6 +39,9 @@ class FFMpegConverter:
birdseye_rtsp: bool = False,
):
if birdseye_rtsp:
if os.path.exists(BIRDSEYE_PIPE):
os.remove(BIRDSEYE_PIPE)
os.mkfifo(BIRDSEYE_PIPE, mode=0o777)
stdin = os.open(BIRDSEYE_PIPE, os.O_RDONLY | os.O_NONBLOCK)
self.bd_pipe = os.open(BIRDSEYE_PIPE, os.O_WRONLY)
@ -96,7 +99,6 @@ class FFMpegConverter:
def exit(self):
if self.bd_pipe:
os.close(self.bd_pipe)
os.remove(BIRDSEYE_PIPE)
self.process.terminate()
try: