BSoftSynth: Revert to Pete's original code
When you change code that you don't understand correctly... just DON'T. Fixes a crash.
This commit is contained in:
@@ -531,10 +531,12 @@ BSoftSynth::PlayBuffer(void* cookie, void* data, size_t size,
|
|||||||
{
|
{
|
||||||
BSoftSynth* synth = (BSoftSynth*)cookie;
|
BSoftSynth* synth = (BSoftSynth*)cookie;
|
||||||
|
|
||||||
if (synth->fMonitor != NULL) {
|
if (synth->fMonitorSize == 0) {
|
||||||
delete[] synth->fMonitor;
|
synth->fMonitor = (float*)new void*[size];
|
||||||
synth->fMonitor = NULL;
|
synth->fMonitorSize = size;
|
||||||
|
synth->fMonitorChans = format.channel_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we use float samples
|
// we use float samples
|
||||||
if (synth->fSynth) {
|
if (synth->fSynth) {
|
||||||
fluid_synth_write_float(
|
fluid_synth_write_float(
|
||||||
@@ -542,12 +544,7 @@ BSoftSynth::PlayBuffer(void* cookie, void* data, size_t size,
|
|||||||
data, 0, format.channel_count,
|
data, 0, format.channel_count,
|
||||||
data, 1, format.channel_count);
|
data, 1, format.channel_count);
|
||||||
|
|
||||||
synth->fMonitor = new float[size];
|
|
||||||
synth->fMonitorSize = size;
|
|
||||||
synth->fMonitorChans = format.channel_count;
|
|
||||||
memcpy(synth->fMonitor, data, size);
|
memcpy(synth->fMonitor, data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user