+ float new_master_speed = change_master_speed.exchange(0.0f / 0.0f);
+ if (!std::isnan(new_master_speed)) {
+ master_speed = new_master_speed;
+ in_pts_origin = in_pts - TIMEBASE * frameno * clip->speed * master_speed / global_flags.output_framerate;
+ out_pts_origin = out_pts - TIMEBASE * frameno / global_flags.output_framerate;
+ }
+
+ if (should_skip_to_next.exchange(false)) { // Test and clear.
+ Clip *clip = &clip_list[clip_idx].clip; // Get a non-const pointer.
+ fprintf(stderr, "pts_out moving to first of %ld and %ld (currently at %f)\n", clip->pts_out, lrint(out_pts + clip->fade_time_seconds * TIMEBASE), out_pts);
+ clip->pts_out = std::min(clip->pts_out, lrint(in_pts + clip->fade_time_seconds * clip->speed * TIMEBASE));
+ }
+