summaryrefslogtreecommitdiff
path: root/dgedit
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-21 17:24:22 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-21 17:24:22 +0200
commitbecd3518e24535df29ef925f3524dca89367e868 (patch)
tree17acf880bda8a0d1cf5c18f5dc571c8e08894409 /dgedit
parentd2b1969c1bd71444b4a35e053700b8a7ecce9e8e (diff)
Fix fadeout. Fix export crashbug.
Diffstat (limited to 'dgedit')
-rw-r--r--dgedit/audioextractor.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/dgedit/audioextractor.cc b/dgedit/audioextractor.cc
index 8cb4ed0..881bfb2 100644
--- a/dgedit/audioextractor.cc
+++ b/dgedit/audioextractor.cc
@@ -106,8 +106,11 @@ void AudioExtractor::exportSelections()
// Apply fadeout
for(size_t fo = 0; fo < fadeout; fo++) {
- float val = ((float)fo / (float)fadeout);
- if(size >= fo) data[size - fo] *= val;
+ float val = 1.0 - ((float)fo / (float)fadeout);
+ if( (((size - fadeout) + fo) < size) &&
+ (((size - fadeout) + fo) >= 0) ) {
+ data[(size - fadeout) + fo] *= val;
+ }
}
audiodata[i].data = data;