projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
77a0c8b
)
On second thoughts, this is a more likely fix for the strange overlap error from...
author
Carl Hetherington
<cth@carlh.net>
Thu, 14 Apr 2016 19:54:49 +0000
(20:54 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 14 Apr 2016 19:54:49 +0000
(20:54 +0100)
src/lib/resampler.cc
patch
|
blob
|
history
diff --git
a/src/lib/resampler.cc
b/src/lib/resampler.cc
index faf07e2a712d974c6d73da3247ab433c4edf6a8e..39b6cd89d05f103735886d7d51256adfb82e761d 100644
(file)
--- a/
src/lib/resampler.cc
+++ b/
src/lib/resampler.cc
@@
-139,12
+139,8
@@
Resampler::flush ()
int out_offset = 0;
int64_t const output_size = 65536;
int out_offset = 0;
int64_t const output_size = 65536;
- /* I think this should only need to be 1 long, but I have seen
- src_process error with "input and output data arrays overlap"
- with dummy[1] (on OS X). I've added a few more for luck.
- */
- float dummy[16];
- float buffer[output_size];
+ float dummy[1];
+ float* buffer = new float[output_size];
SRC_DATA data;
data.data_in = dummy;
SRC_DATA data;
data.data_in = dummy;
@@
-156,6
+152,7
@@
Resampler::flush ()
int const r = src_process (_src, &data);
if (r) {
int const r = src_process (_src, &data);
if (r) {
+ delete[] buffer;
throw EncodeError (String::compose (N_("could not run sample-rate converter (%1)"), src_strerror (r)));
}
throw EncodeError (String::compose (N_("could not run sample-rate converter (%1)"), src_strerror (r)));
}
@@
-172,5
+169,6
@@
Resampler::flush ()
out_offset += data.output_frames_gen;
out->set_frames (out_offset);
out_offset += data.output_frames_gen;
out->set_frames (out_offset);
+ delete[] buffer;
return out;
}
return out;
}