when DiskReader checks to see if a locate is in progress, it must be atomic with...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 5 Jul 2017 21:24:02 +0000 (17:24 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 18 Sep 2017 15:40:53 +0000 (11:40 -0400)
libs/ardour/ardour/session.h
libs/ardour/disk_reader.cc
libs/ardour/session.cc
libs/ardour/session_process.cc

index d6c49e489c3fbd2ff92f8f47bc7dcf76e28fbf80..70be771ef4cdda01f5701004f49b724fa1a0bbf5 100644 (file)
@@ -433,6 +433,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        void adjust_playback_buffering();
        void adjust_capture_buffering();
 
+       bool global_locate_pending() const { return _global_locate_pending; }
        bool locate_pending() const { return static_cast<bool>(post_transport_work()&PostTransportLocate); }
        bool declick_out_pending() const { return static_cast<bool>(transport_sub_state&(PendingDeclickOut)); }
        bool transport_locked () const;
@@ -2095,6 +2096,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        boost::weak_ptr<MidiTrack> current_midi_target;
 
        CoreSelection* _selection;
+
+       bool _global_locate_pending;
 };
 
 
index 1dee19522ca2d025f1022958e3703732819a9c84..98bb05f0d6f2af826240ede5e6cb74b300d817c5 100644 (file)
@@ -277,7 +277,7 @@ DiskReader::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame,
        }
 
        BufferSet& scratch_bufs (_session.get_scratch_buffers (bufs.count()));
-       const bool still_locating = _session.locate_pending();
+       const bool still_locating = _session.global_locate_pending();
 
        if (!result_required || ((ms & MonitoringDisk) == 0) || still_locating) {
 
index b658487969c3827479096ab426e66c538c20892d..a880ff0a097855c08d622a1f3b4dfd10c3e69fbe 100644 (file)
@@ -328,6 +328,7 @@ Session::Session (AudioEngine &eng,
        , _mmc (0)
        , _vca_manager (new VCAManager (*this))
        , _selection (new CoreSelection (*this))
+       , _global_locate_pending (false)
 {
        uint32_t sr = 0;
 
index c1230fc09eb0b1ea811be26ade6c80cddfae4a64..19a6b647209294879c886d5fab2124dd58669e10 100644 (file)
@@ -192,6 +192,8 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
                (*i)->automation_run (start_frame, nframes);
        }
 
+       _global_locate_pending = locate_pending ();
+
        if (_process_graph) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
                if (_process_graph->process_routes (nframes, start_frame, end_frame, declick, need_butler) < 0) {
@@ -243,6 +245,8 @@ Session::silent_process_routes (pframes_t nframes, bool& need_butler)
                (*i)->automation_run (start_frame, nframes);
        }
 
+       _global_locate_pending = locate_pending();
+
        if (_process_graph) {
                _process_graph->silent_process_routes (nframes, start_frame, end_frame, need_butler);
        } else {