{
mlt_properties_set_int( properties, "image_count", mlt_properties_get_int( properties, "image_count" ) - 1 );
error = get_image( this, buffer, format, width, height, writable );
- if ( !error )
+ if ( !error && *buffer )
{
mlt_properties_set_int( properties, "width", *width );
mlt_properties_set_int( properties, "height", *height );
*buffer = mlt_properties_get_data( properties, "image", NULL );
*width = mlt_properties_get_int( properties, "width" );
*height = mlt_properties_get_int( properties, "height" );
- if ( this->convert_image )
+ if ( this->convert_image && *buffer )
this->convert_image( this, buffer, format, requested_format );
}
else if ( producer )
mlt_properties_set_data( frame_properties, "avformat.image_cache", item, 0, ( mlt_destructor )mlt_cache_item_close, NULL );
mlt_properties_set_data( frame_properties, "image", *buffer, size, NULL, NULL );
this->top_field_first = mlt_properties_get_int( frame_properties, "top_field_first" );
+ this->got_picture = 1;
goto exit_get_image;
}
}
}
}
- if ( !got_picture )
- mlt_frame_get_image( frame, buffer, format, width, height, writable );
}
avformat_unlock();
// Regardless of speed, we expect to get the next frame (cos we ain't too bright)
this->video_expected = position + 1;
- return 0;
+ return !this->got_picture;
}
/** Process properties as AVOptions and apply to AV context obj