Fix video termination logic

This commit is contained in:
kris 2019-03-24 00:14:41 +00:00
parent dd422d1156
commit 21a4ac0186

View File

@ -79,7 +79,7 @@ class Movie:
:return:
"""
for op in ops:
if self.stream_pos >= self.max_bytes_out:
if self.max_bytes_out and self.stream_pos >= self.max_bytes_out:
yield from self.done()
return
# Keep track of where we are in TCP client socket buffer
@ -89,6 +89,8 @@ class Movie:
yield from self._emit_bytes(opcodes.Ack())
yield from self._emit_bytes(op)
yield from self.done()
def done(self) -> Iterator[int]:
"""Terminate opcode stream.