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/ardour/disk_io.h | 8 -------- libs/ardour/ardour/disk_reader.h | 13 ++++++++++--- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'libs/ardour/ardour') diff --git a/libs/ardour/ardour/disk_io.h b/libs/ardour/ardour/disk_io.h index 867a5e89d1..65486febf4 100644 --- a/libs/ardour/ardour/disk_io.h +++ b/libs/ardour/ardour/disk_io.h @@ -111,10 +111,6 @@ public: virtual void adjust_buffering() = 0; - Glib::Threads::Mutex rbuf_lock; - void queue_switch_rbuf (); - void switch_rbufs (); - protected: friend class Auditioner; virtual int seek (samplepos_t which_sample, bool complete_refill = false) = 0; @@ -147,10 +143,6 @@ protected: samplepos_t capture_val; ///< The start or end file sample position }; - bool _switch_rbuf; - int process_rbuf; - int other_rbuf; - /** Information about one audio channel, playback or capture * (depending on the derived class) */ diff --git a/libs/ardour/ardour/disk_reader.h b/libs/ardour/ardour/disk_reader.h index 970295b6c2..e43192f0ff 100644 --- a/libs/ardour/ardour/disk_reader.h +++ b/libs/ardour/ardour/disk_reader.h @@ -117,6 +117,10 @@ public: static void reset_loop_declick (Location*, samplecnt_t sample_rate); static void alloc_loop_declick (samplecnt_t sample_rate); + Glib::Threads::Mutex rbuf_lock; + void queue_switch_rbuf (); + void switch_rbufs (); + protected: friend class Track; friend class MidiTrack; @@ -182,10 +186,11 @@ protected: }; private: - /** The number of samples by which this diskstream's output should be delayed - with respect to the transport sample. This is used for latency compensation. - */ + bool _switch_rbuf; + int process_rbuf; + int other_rbuf; samplepos_t overwrite_sample; + samplepos_t new_file_sample; mutable gint _pending_overwrite; bool overwrite_queued; bool run_must_resolve; @@ -228,6 +233,8 @@ private: void get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, samplepos_t end_sample, MonitorState, BufferSet&, double speed, samplecnt_t distance); void maybe_xfade_loop (Sample*, samplepos_t read_start, samplepos_t read_end, ReaderChannelInfo*); + + }; } // namespace -- cgit v1.2.3