Fix importing to a fixed-point format with resampling
authorRobin Gareus <robin@gareus.org>
Fri, 7 Dec 2018 03:15:55 +0000 (04:15 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 7 Dec 2018 03:16:28 +0000 (04:16 +0100)
ResampledImportableSource::read() returns audio-frames;
multiplication by number of channels read beyond the buffer.

libs/ardour/import.cc

index 4c740c4d31d7a3449660c240da858c913f472fed..977729ddc9a586f5c6082b547966a677a9842903 100644 (file)
@@ -278,7 +278,7 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
                                break;
                        }
 
-                       peak = compute_peak (data.get(), nread * channels, peak);
+                       peak = compute_peak (data.get(), nread, peak);
 
                        read_count += nread / channels;
                        status.progress = 0.5 * read_count / (source->ratio() * source->length() * channels);