From 21a4ac01863d908db961cc6ecf7e82b41cfd0aed Mon Sep 17 00:00:00 2001 From: kris Date: Sun, 24 Mar 2019 00:14:41 +0000 Subject: [PATCH] Fix video termination logic --- transcoder/movie.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transcoder/movie.py b/transcoder/movie.py index d5bed33..6bee59f 100644 --- a/transcoder/movie.py +++ b/transcoder/movie.py @@ -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.