Fix loop condition so it can be run through more than once.
patch by Wolfram Gloger, wmglo dent.med.uni-muenchen de
reference: [Ffmpeg-devel] buffer underflow messages from the output_example.c

Originally committed as revision 8860 to svn://svn.ffmpeg.org/ffmpeg/trunk
