From cf7bfae926d1a3f48b4b2e9a3a9d72974f031def Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 8 Dec 2019 22:37:07 -0700 Subject: fix error when continuing to refill audio playback buffers after a buffer switch The file_sample[AUDIO] member was not updated to reflect the last-read sample in the switched-to buffer. Also move several methods and members from DiskIO to DiskReader where they belong. --- libs/ardour/disk_io.cc | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'libs/ardour/disk_io.cc') diff --git a/libs/ardour/disk_io.cc b/libs/ardour/disk_io.cc index d6d076099e..7d153661b9 100644 --- a/libs/ardour/disk_io.cc +++ b/libs/ardour/disk_io.cc @@ -55,9 +55,6 @@ DiskIOProcessor::DiskIOProcessor (Session& s, string const & str, Flag f) , in_set_state (false) , playback_sample (0) , _need_butler (false) - , _switch_rbuf (false) - , process_rbuf (0) - , other_rbuf (1) , channels (new ChannelList) , _midi_buf (0) , _samples_written_to_ringbuffer (0) @@ -347,32 +344,6 @@ DiskIOProcessor::ChannelInfo::~ChannelInfo () capture_transition_buf = 0; } -void -DiskIOProcessor::queue_switch_rbuf () -{ - /* must hold _rbuf_lock */ - _switch_rbuf = true; -} - -void -DiskIOProcessor::switch_rbufs () -{ - /* must hold _rbuf_lock */ - assert (_switch_rbuf); - - std::swap (process_rbuf, other_rbuf); - - boost::shared_ptr c = channels.reader(); - - for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) { - (*chan)->rbuf[other_rbuf]->reset (); - cerr << name() << " after switch/reset, other has " << (*chan)->rbuf[other_rbuf]->write_space() << " of " << (*chan)->rbuf[other_rbuf]->bufsize() << endl; - } - - _switch_rbuf = false; - cerr << "switched, pbuf now " << process_rbuf << " size " << c->front()->rbuf[process_rbuf]->bufsize() << " other " << other_rbuf << " size " << c->front()->rbuf[other_rbuf]->bufsize() << endl; -} - void DiskIOProcessor::drop_track () { -- cgit v1.2.3