catch thrown exception when rounding backwards from a position too close to zero

git-svn-id: svn://localhost/ardour2/branches/3.0@7481 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2010-07-23 23:30:11 +00:00
parent cd6c3af27d
commit e3241a03cf

View File

@@ -1176,7 +1176,13 @@ TempoMap::round_to_beat_subdivision (nframes64_t fr, int sub_num, int dir)
difference = mod;
}
the_beat = bbt_subtract (the_beat, BBT_Time (0, 0, difference));
try {
the_beat = bbt_subtract (the_beat, BBT_Time (0, 0, difference));
} catch (...) {
/* can't go backwards from wherever pos is, so just return it */
return fr;
}
} else {
/* round to nearest */