- if (play_loop && !synced_to_jack()) {
- Location *location = _locations.auto_loop_location();
-
- if (location != 0) {
- _transport_frame = location->start();
- do_locate = true;
+ if (Config->get_auto_return()) {
+
+ if (play_loop) {
+
+ /* don't try to handle loop play when synced to JACK */
+
+ if (!synced_to_jack()) {
+
+ Location *location = _locations.auto_loop_location();
+
+ if (location != 0) {
+ _transport_frame = location->start();
+ } else {
+ _transport_frame = _last_roll_location;
+ }
+ do_locate = true;
+ }
+
+ } else if (_play_range) {
+
+ /* return to start of range */
+
+ if (!current_audio_range.empty()) {
+ _transport_frame = current_audio_range.front().start;
+ do_locate = true;
+ }
+