summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-07-23 23:30:11 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-07-23 23:30:11 +0000
commite3241a03cf3d3d4cc09c125340444c6f72e0346b (patch)
tree690f540fccaa4361687eec4e8b934463f69b7013 /libs/ardour
parentcd6c3af27d754e7d7dd09049c9fdb26af0120523 (diff)
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
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/tempo.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 9b06d8868f..a60b0d32d3 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -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 */