waiting until the returned size is == 0 isn't adequate.
you must use the function x264_encoder_delayed_frames
encoding very short clips resulted in invalid unplayable files.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3186
b64f7644-9d1e-0410-96f1-
a4d463321fa5
x264_nal_t *nal;
hb_buffer_t *last_buf = NULL;
- while (1)
+ while ( x264_encoder_delayed_frames( pv->x264 ) )
{
x264_encoder_encode( pv->x264, &nal, &i_nal, NULL, &pic_out );
- if ( i_nal <= 0 )
+ if ( i_nal == 0 )
+ continue;
+ if ( i_nal < 0 )
break;
hb_buffer_t *buf = nal_encode( w, &pic_out, i_nal, nal );