xvid_enc_frame_t frame;
hb_buffer_t * in = *buf_in, * buf;
+ /* If this is the last empty frame, we're done */
+ if(!in->data)
+ {
+ *buf_out = NULL;
+ return HB_WORK_DONE;
+ }
+
/* Should be way too large */
buf = hb_buffer_init( 3 * job->width * job->height / 2 );
buf->start = in->start;
buf->stop = in->stop;
+ //buf->chap = in->chap;
memset( &frame, 0, sizeof( frame ) );
frame.quant_inter_matrix = NULL;
buf->size = xvid_encore( pv->xvid, XVID_ENC_ENCODE, &frame, NULL );
- buf->key = ( frame.out_flags & XVID_KEYFRAME );
+ buf->frametype = ( frame.out_flags & XVID_KEYFRAME ) ? HB_FRAME_KEY : HB_FRAME_REF;
if( !pv->configDone )
{