To be clear, patch 4/6 does two things: call get_output_samples() before ProcessInput() [which isn't mentioned in the subject], and propagate failure from process_output(). The former really should be spelled out explicitly, in the git history, and I'd prefer it to be a separate change.