we need to break out, when no data is comming
This commit is contained in:
parent
f52a045eef
commit
66f6a4242d
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
||||
.DS_Store
|
||||
__pycache__/
|
||||
*-orig.*
|
||||
*.json
|
||||
|
20
ffplayout.py
20
ffplayout.py
@ -978,19 +978,21 @@ def play_clips(buffer, GetSourceIter):
|
||||
[
|
||||
'ffmpeg', '-v', 'error', '-hide_banner', '-nostats'
|
||||
] + src_cmd + list(ff_pre_settings),
|
||||
stdout=PIPE,
|
||||
stderr=PIPE,
|
||||
stdin=PIPE
|
||||
stdout=PIPE
|
||||
)
|
||||
|
||||
for package in iter(decoder.stdout.readline, ''):
|
||||
buffer.put(package)
|
||||
for data in iter(decoder.stdout.readline, ''):
|
||||
if not data:
|
||||
break
|
||||
|
||||
buffer.put(data)
|
||||
|
||||
# TODO: make this nicer
|
||||
except Exception:
|
||||
print(traceback.format_exc())
|
||||
|
||||
finally:
|
||||
buffer.put(None)
|
||||
decoder.wait()
|
||||
|
||||
|
||||
@ -1053,8 +1055,12 @@ def main():
|
||||
# while True is bad, it needs a check to be able to exit
|
||||
# with this loop we also end up never in the check_process function
|
||||
while True:
|
||||
line = buffer.get()
|
||||
playout.stdin.write(line)
|
||||
data = buffer.get()
|
||||
if not data:
|
||||
playout.terminate()
|
||||
break
|
||||
|
||||
playout.stdin.write(data)
|
||||
|
||||
check_process(play_thread, playout)
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user