avoid a locate-to-loop-start from cancelling looping
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 9 Dec 2019 00:00:30 +0000 (17:00 -0700)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 9 Dec 2019 00:01:17 +0000 (17:01 -0700)
libs/ardour/session.cc

index 7e107b3056e44e9364f0b82382046aad178d9635..ad5079ee85273858bcd599586f6a0afaa05508fa 100644 (file)
@@ -1430,24 +1430,26 @@ Session::auto_loop_changed (Location* location)
 
                if (play_loop) {
 
-                       /* Set this so that when/if we have to stop the
-                        * transport for a locate, we know that it is triggered
-                        * by loop-changing, and we do not cancel play loop
-                        */
+                       if (_transport_sample < location->start() || _transport_sample > location->end()) {
 
-                       loop_changing = true;
+                               /* new loop range excludes current transport
+                                * sample => relocate to beginning of loop and roll.
+                                */
 
-                       if (_transport_sample < location->start() || _transport_sample > location->end()) {
-                               // new loop range excludes current transport
-                               // sample => relocate to beginning of loop and roll.
+                               /* Set this so that when/if we have to stop the
+                                * transport for a locate, we know that it is triggered
+                                * by loop-changing, and we do not cancel play loop
+                                */
 
+                               loop_changing = true;
                                request_locate (location->start(), true);
 
-                       }
+                       } else {
 
-                       // schedule a buffer overwrite to refill buffers with the new loop.
+                               // schedule a buffer overwrite to refill buffers with the new loop.
 
-                       request_overwrite_buffer (boost::shared_ptr<Track>());
+                               request_overwrite_buffer (boost::shared_ptr<Track>());
+                       }
                }
 
        } else {