Fix regression in most recent commit d658f9b.

It could trigger audio encode errors.
Extend samples-per-frame fix to multi audio stream out.
Fail on continual encoding errors.

Prevents an infinite loop that may occur.