int next_height = *height;
mlt_log_debug( MLT_FILTER_SERVICE(filter), "previous %d current %d next %d\n",
- previous_frame? mlt_frame_get_position(previous_frame) : -1,
- mlt_frame_get_position(frame),
- next_frame? mlt_frame_get_position(next_frame) : -1);
+ previous_frame? mlt_frame_original_position(previous_frame) : -1,
+ mlt_frame_original_position(frame),
+ next_frame? mlt_frame_original_position(next_frame) : -1);
if ( !previous_frame || !next_frame )
return 1;
+ // Some producers like pixbuf want rescale_width & _height, but will not get them if you request
+ // the previous image first. So, on the first iteration, we make the previous frame the same
+ // as the current frame.
+ if ( !mlt_properties_get_int( MLT_FILTER_PROPERTIES(filter), "_notfirst" ) )
+ {
+ previous_frame = frame;
+ mlt_properties_set_int( MLT_FILTER_PROPERTIES(filter), "_notfirst", 1 );
+ }
+
// Get the preceding frame's image
int error = mlt_frame_get_image( previous_frame, &previous_image, format, &previous_width, &previous_height, 0 );
int progressive = mlt_properties_get_int( MLT_FRAME_PROPERTIES( previous_frame ), "progressive" );
if ( !error && previous_image && !progressive )
{
// OK, now we know we have work to do and can request the image in our format
- *format = mlt_image_yuv422;
- error = mlt_frame_get_image( previous_frame, &previous_image, format, &previous_width, &previous_height, 0 );
+ frame->convert_image( previous_frame, &previous_image, format, mlt_image_yuv422 );
// Get the current frame's image
*format = mlt_image_yuv422;