fix bug where encoders sometimes need larger packets by reseting
the output packet each time through the loop. This will result in the
Ffmpeg encode allocating a new packet of the correct size.
and fix bug where when flushing audio encoders we passed crap audio into
encode due to not correctly checking completeness of the resampler
audio.
minor formatting