hb_buffer_t ** buf_out )
{
hb_work_private_t *pv = w->private_data;
- if ( ! pv->context )
- {
- init_ffmpeg_context( w );
- }
hb_buffer_t *in = *buf_in;
*buf_in = NULL;
if ( in->size == 0 )
{
/* flush any frames left in the decoder */
- while ( decodeFrame( pv, NULL, 0 ) )
+ while ( pv->context && decodeFrame( pv, NULL, 0 ) )
{
}
flushDelayQueue( pv );
return HB_WORK_DONE;
}
+ if ( ! pv->context )
+ {
+ init_ffmpeg_context( w );
+ }
+
int64_t pts = in->start;
if( pts >= 0 )
{