Fix MIDI audition

This commit is contained in:
Robin Gareus 2025-12-11 06:08:29 +01:00
parent fca4083e12
commit f0a52eccc0
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 11 additions and 13 deletions

View file

@ -471,15 +471,9 @@ Auditioner::audition_region (std::shared_ptr<Region> region, bool loop)
_disk_reader->seek (offset.samples(), true);
if (_midi_audition) {
/* Fill MIDI buffers.
* This is safe to call from here. ::::audition_region()
* is called by the butler thread. Also the session is not
* yet auditioning. So Session::non_realtime_overwrite()
* does call the auditioner's DR.
*/
/* Request Fill MIDI buffers. */
_queue_panic = true;
set_pending_overwrite (PlaylistModified);
_disk_reader->overwrite_existing_buffers ();
}
current_sample = offset.samples();

View file

@ -257,13 +257,17 @@ Butler::thread_work ()
}
}
sampleoffset_t audition_seek;
if (should_run && _session.is_auditioning () && (audition_seek = _session.the_auditioner ()->seek_sample ()) >= 0) {
if (should_run && _session.is_auditioning ()) {
std::shared_ptr<Track> tr = std::dynamic_pointer_cast<Track> (_session.the_auditioner ());
DEBUG_TRACE (DEBUG::Butler, "seek the auditioner\n");
tr->seek (audition_seek);
tr->do_refill ();
_session.the_auditioner ()->seek_response (audition_seek);
sampleoffset_t audition_seek;
if ((audition_seek = _session.the_auditioner ()->seek_sample ()) >= 0) {
DEBUG_TRACE (DEBUG::Butler, "seek the auditioner\n");
tr->seek (audition_seek);
tr->do_refill ();
_session.the_auditioner ()->seek_response (audition_seek);
} else if (tr->pending_overwrite ()) {
tr->overwrite_existing_buffers ();
}
}
std::shared_ptr<RouteList const> rl = _session.get_routes ();