13
0

fix bug in find_next_region() when starting frame matches region start

git-svn-id: svn://localhost/ardour2/trunk@1049 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-11-01 19:02:03 +00:00
parent a0e8568266
commit bc3afc09e8

View File

@ -1252,6 +1252,7 @@ Playlist::find_next_region (nframes_t frame, RegionPoint point, int dir)
boost::shared_ptr<Region> ret;
nframes_t closest = max_frames;
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
nframes_t distance;
@ -1273,7 +1274,7 @@ Playlist::find_next_region (nframes_t frame, RegionPoint point, int dir)
switch (dir) {
case 1: /* forwards */
if (pos > frame) {
if (pos >= frame) {
if ((distance = pos - frame) < closest) {
closest = distance;
ret = r;
@ -1284,7 +1285,7 @@ Playlist::find_next_region (nframes_t frame, RegionPoint point, int dir)
default: /* backwards */
if (pos < frame) {
if (pos <= frame) {
if ((distance = frame - pos) < closest) {
closest = distance;
ret = r;