add ability to shut down encoder (release all waiting threads)