fix auditioning of regions with offset - fixes #6131
authorRobin Gareus <robin@gareus.org>
Tue, 13 Jan 2015 17:36:10 +0000 (18:36 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 13 Jan 2015 17:36:10 +0000 (18:36 +0100)
libs/ardour/auditioner.cc

index 96304b0b3beee4db77bf9a88af3b8d071f4a60f7..184688c3c3f6fe2e937b2c0d8927861283a8fa8a 100644 (file)
@@ -514,7 +514,7 @@ Auditioner::play_audition (framecnt_t nframes)
 
        if(!_seeking) {
                /* process audio */
-               this_nframes = min (nframes, length - current_frame);
+               this_nframes = min (nframes, length - current_frame + _import_position);
 
                if ((ret = roll (this_nframes, current_frame, current_frame + nframes, false, need_butler)) != 0) {
                        silence (nframes);
@@ -538,7 +538,7 @@ Auditioner::play_audition (framecnt_t nframes)
                AuditionProgress(current_frame - _import_position, length); /* emit */
        }
 
-       if (current_frame >= length) {
+       if (current_frame >= length + _import_position) {
                _session.cancel_audition ();
                return 0;
        } else {