Remove unused MIDI-flush

realtime_stop() calls unset_play_loop(), unless loop is a
transport-state. Any later calls by butler_transport_work()
will never reach this get_play_loop() clause when just looping.

Besides while recording, locates are not possible,
so this case never triggered under normal operation
(Non-seamless looping is no longer supported since 6.0).
This commit is contained in:
Robin Gareus 2021-07-11 02:35:15 +02:00
parent b0e33d7d65
commit 38841eccaf
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 0 additions and 88 deletions

View file

@ -66,8 +66,6 @@ class LIBARDOUR_API Butler : public SessionHandleRef
samplecnt_t audio_playback_buffer_size() const { return _audio_playback_buffer_size; }
uint32_t midi_buffer_size() const { return _midi_buffer_size; }
bool flush_tracks_to_disk_after_locate (boost::shared_ptr<RouteList>, uint32_t& errors);
static void* _thread_work(void *arg);
void* thread_work();

View file

@ -376,55 +376,6 @@ Butler::flush_tracks_to_disk_normal (boost::shared_ptr<RouteList> rl, uint32_t&
return disk_work_outstanding;
}
bool
Butler::flush_tracks_to_disk_after_locate (boost::shared_ptr<RouteList> rl, uint32_t& errors)
{
bool disk_work_outstanding = false;
/* almost the same as the "normal" version except that we do not test
* for transport_work_requested() and we force flushes.
*/
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
// cerr << "write behind for " << (*i)->name () << endl;
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
if (!tr) {
continue;
}
/* note that we still try to flush diskstreams attached to inactive routes
*/
int ret;
DEBUG_TRACE (DEBUG::Butler, string_compose ("butler flushes track %1 capture load %2\n", tr->name(), tr->capture_buffer_load()));
ret = tr->do_flush (ButlerContext, true);
switch (ret) {
case 0:
DEBUG_TRACE (DEBUG::Butler, string_compose ("\tflush complete for %1\n", tr->name()));
break;
case 1:
DEBUG_TRACE (DEBUG::Butler, string_compose ("\tflush not finished for %1\n", tr->name()));
disk_work_outstanding = true;
break;
default:
errors++;
error << string_compose(_("Butler write-behind failure on dstream %1"), (*i)->name()) << endmsg;
std::cerr << string_compose(_("Butler write-behind failure on dstream %1"), (*i)->name()) << std::endl;
/* don't break - try to flush all streams in case they
are split across disks.
*/
}
}
return disk_work_outstanding;
}
void
Butler::schedule_transport_work ()
{

View file

@ -1069,43 +1069,6 @@ Session::butler_transport_work (bool have_process_lock)
DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler transport work, todo = [%1] (0x%3%4%5) at %2\n", enum_2_string (ptw), (before = g_get_monotonic_time()), std::hex, ptw, std::dec));
if (ptw & PostTransportLocate) {
if (get_play_loop()) {
DEBUG_TRACE (DEBUG::Butler, "flush loop recording fragment to disk\n");
/* this locate might be happening while we are
* loop recording.
*
* Non-seamless looping will require a locate (below) that
* will reset capture buffers and throw away data.
*
* Rather than first find all tracks and see if they
* have outstanding data, just do a flush anyway. It
* may be cheaper this way anyway, and is certainly
* more accurate.
*/
bool more_disk_io_to_do = false;
uint32_t errors = 0;
do {
more_disk_io_to_do = _butler->flush_tracks_to_disk_after_locate (r, errors);
if (errors) {
break;
}
if (more_disk_io_to_do) {
continue;
}
} while (false);
}
}
if (ptw & PostTransportAdjustPlaybackBuffering) {
/* need to prevent concurrency with ARDOUR::Reader::run(),
* DiskWriter::adjust_buffering() re-allocates the ringbuffer */