summaryrefslogtreecommitdiff
path: root/libs/ardour/region.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-10-13 15:56:48 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-10-13 15:56:48 +0000
commitfdb6d217e93dc0ac20c0efc4eca65a5ce63db72b (patch)
tree34b55837555f110e88961f3edb4637eb99639fe0 /libs/ardour/region.cc
parent990ca1370080a935b4221e96698f84b919a9fb98 (diff)
fix subtle but nasty problems with stretch/shift audio operations, and fix up handling of older sessions with illegal stretch/shift values in them
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3954 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r--libs/ardour/region.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 129568a4c9..5efa20c8d7 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -65,7 +65,7 @@ Region::Region (nframes_t start, nframes_t length, const string& name, layer_t l
_sync_position = _start;
_length = length;
_last_length = length;
- _ancestral_start = start;
+ _ancestral_start = 0;
_ancestral_length = length;
_stretch = 1.0;
_shift = 1.0;
@@ -1021,12 +1021,24 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
if ((prop = node.property ("stretch")) != 0) {
_stretch = atof (prop->value());
+ /* fix problem with old sessions corrupted by an impossible
+ value for _stretch
+ */
+ if (_stretch == 0.0) {
+ _stretch = 1.0;
+ }
} else {
_stretch = 1.0;
}
if ((prop = node.property ("shift")) != 0) {
_shift = atof (prop->value());
+ /* fix problem with old sessions corrupted by an impossible
+ value for _shift
+ */
+ if (_shift == 0.0) {
+ _shift = 1.0;
+ }
} else {
_shift = 1.0;
}