88996aef73
The previous commit (672378d20) was supposed to fix issues with the encoder releasing while data was still being processed, but did not account for when the encoder has never started up. That was my fault. Furthermore, the way in which it was waiting to drain events was incorrect. The encoder may still be active even though there aren't any events queued. The proper way to wait for an async encoder to finish up is to process output samples until it requests more input samples.