13
0

Fix warning about getting tempo map for frame -1; stop

session files with left-frame=-1 causing the same
problem on reload (#4654).


git-svn-id: svn://localhost/ardour2/branches/3.0@11339 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-01-24 20:48:08 +00:00
parent eadc2192c5
commit bf8dbbaca7
2 changed files with 8 additions and 0 deletions

View File

@ -2243,6 +2243,9 @@ Editor::set_state (const XMLNode& node, int /*version*/)
if ((prop = node.property ("left-frame")) != 0) {
framepos_t pos;
if (sscanf (prop->value().c_str(), "%" PRId64, &pos) == 1) {
if (pos < 0) {
pos = 0;
}
reset_x_origin (pos);
}
}
@ -4308,6 +4311,7 @@ Editor::idle_visual_changer ()
*/
leftmost_frame = pending_visual_change.time_origin;
assert (leftmost_frame >= 0);
}
if (p & VisualChange::ZoomLevel) {

View File

@ -1581,6 +1581,10 @@ Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end, const string &
new_leftmost = 0;
}
if (new_leftmost < 0) {
new_leftmost = 0;
}
reposition_and_zoom (new_leftmost, new_fpu);
}