diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-08 22:37:07 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-08 22:39:31 -0700 |
commit | cf7bfae926d1a3f48b4b2e9a3a9d72974f031def (patch) | |
tree | 381959d76a4397227e3969604e9eb5021ec0a52f /libs/ardour/ardour | |
parent | b1b29a631719cbf5238af3818e7707e869d3f87d (diff) |
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.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/disk_io.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/disk_reader.h | 13 |
2 files changed, 10 insertions, 11 deletions
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 |