mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2025-06-13 11:37:56 +00:00
Allow player to exit cleanly
- can't emit Terminate opcode in the middle of the bytestream - pad the TCP stream to next 2k boundary when emitting terminate opcode, since the player will block until receiving this much data.
This commit is contained in:
@ -29,12 +29,12 @@ def main(args):
|
||||
m = movie.Movie(
|
||||
filename,
|
||||
every_n_video_frames=args.every_n_video_frames,
|
||||
audio_normalization=args.audio_normalization)
|
||||
audio_normalization=args.audio_normalization,
|
||||
max_bytes_out = 1024. * 1024 * args.max_output_mb
|
||||
)
|
||||
|
||||
print("Input frame rate = %f" % m.video.input_frame_rate)
|
||||
|
||||
max_bytes_out = 1024. * 1024 * args.max_output_mb
|
||||
|
||||
if args.output:
|
||||
out_filename = args.output
|
||||
else:
|
||||
@ -45,11 +45,6 @@ def main(args):
|
||||
for bytes_out, b in enumerate(m.emit_stream(m.encode())):
|
||||
out.write(bytearray([b]))
|
||||
|
||||
if max_bytes_out and bytes_out >= max_bytes_out:
|
||||
break
|
||||
|
||||
out.write(bytes(m.done()))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(parser.parse_args())
|
||||
|
Reference in New Issue
Block a user