fixed the issue where the encoder cannot exit

This commit is contained in:
k4yt3x
2022-08-28 15:03:16 +00:00
parent f7d6dc41b3
commit 29a55e633c
2 changed files with 5 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ __ __ _ _ ___ __ __
Name: Video2X
Creator: K4YT3X
Date Created: February 24, 2018
Last Modified: April 30, 2022
Last Modified: August 28, 2022
Editor: BrianPetkovsek
Last Modified: June 17, 2019
@@ -332,11 +332,6 @@ class Video2X:
decoder_thread.stop()
decoder_thread.join()
# stop the encoder
encoder.join()
logger.critical("ENCODER")
# clear queue and signal processors to exit
# multiprocessing.Queue has no Queue.queue.clear
while tasks_queue.empty() is not True:
@@ -348,6 +343,9 @@ class Video2X:
processor_pool.close()
processor_pool.join()
# stop the encoder
encoder.join()
# restore original STDOUT and STDERR
sys.stdout = original_stdout
sys.stderr = original_stderr