diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-04-21 17:24:22 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-04-21 17:24:22 +0200 |
commit | becd3518e24535df29ef925f3524dca89367e868 (patch) | |
tree | 17acf880bda8a0d1cf5c18f5dc571c8e08894409 /dgedit | |
parent | d2b1969c1bd71444b4a35e053700b8a7ecce9e8e (diff) |
Fix fadeout. Fix export crashbug.
Diffstat (limited to 'dgedit')
-rw-r--r-- | dgedit/audioextractor.cc | 7 |
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; |