Fix Loop recording

DiskWriter::seek() flushes all recorded audio/MIDI, and resets
buffers as if no recording has happened.

Data must be flushed to disk before any non-realtime locates happen.
This happens at transport-stop, which is usually called first.

Except since 8b048bb351 Session::butler_transport_work() may call
non_realtime_stop() after a non_realtime_locate() when looping
more than once.
This commit is contained in:
Robin Gareus 2021-07-11 02:29:21 +02:00
parent dfa34f2885
commit b0e33d7d65
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1142,14 +1142,6 @@ Session::butler_transport_work (bool have_process_lock)
}
}
const int butler = g_atomic_int_get (&_butler_seek_counter);
const int rtlocates = g_atomic_int_get (&_seek_counter);
if (butler != rtlocates) {
DEBUG_TRACE (DEBUG::Transport, string_compose ("nonrealtime locate invoked from BTW (butler has done %1, rtlocs %2)\n", butler, rtlocates));
non_realtime_locate ();
}
if (ptw & PostTransportStop) {
non_realtime_stop (ptw & PostTransportAbort, on_entry, finished);
if (!finished) {
@ -1158,6 +1150,14 @@ Session::butler_transport_work (bool have_process_lock)
}
}
const int butler = g_atomic_int_get (&_butler_seek_counter);
const int rtlocates = g_atomic_int_get (&_seek_counter);
if (butler != rtlocates) {
DEBUG_TRACE (DEBUG::Transport, string_compose ("nonrealtime locate invoked from BTW (butler has done %1, rtlocs %2)\n", butler, rtlocates));
non_realtime_locate ();
}
if (ptw & PostTransportOverWrite) {
non_realtime_overwrite (on_entry, finished, (ptw & PostTransportLoopChanged));
if (!finished) {