- // Calculate the interpolated frame. When it's done, the destination
- // will be unblocked.
- destination->setFrame(primary_stream_idx, pts, /*interpolated=*/true, secondary_stream_idx, secondary_pts, fade_alpha);
- video_stream->schedule_interpolated_frame(pts, primary_stream_idx, in_pts_lower, in_pts_upper, alpha, secondary_stream_idx, secondary_pts, fade_alpha);
+ auto display_func = [this, primary_stream_idx, pts, secondary_stream_idx, secondary_pts, fade_alpha]{
+ destination->setFrame(primary_stream_idx, pts, /*interpolated=*/true, secondary_stream_idx, secondary_pts, fade_alpha);
+ };
+ video_stream->schedule_interpolated_frame(
+ next_frame_start, pts, display_func, QueueSpotHolder(this),
+ primary_stream_idx, in_pts_lower, in_pts_upper, alpha,
+ secondary_stream_idx, secondary_pts, fade_alpha);