Compare commits
2 Commits
492a5beba4
...
b837e7d36a
Author | SHA1 | Date |
---|---|---|
ChuckMash | b837e7d36a | |
Infinity | 51a584c2b7 |
|
@ -302,6 +302,7 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output)
|
|||
synth = reinterpret_cast<struct mad_synth *>(preallocateSynthSpace);
|
||||
}
|
||||
else {
|
||||
output->stop();
|
||||
audioLogger->printf_P("OOM error in MP3: Want %d/%d/%d/%d bytes, have %d/%d/%d/%d bytes preallocated.\n",
|
||||
preAllocBuffSize(), preAllocStreamSize(), preAllocFrameSize(), preAllocSynthSize(),
|
||||
preallocateSize, preallocateStreamSize, preallocateFrameSize, preallocateSynthSize);
|
||||
|
@ -319,6 +320,7 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output)
|
|||
p += preAllocSynthSize();
|
||||
int neededBytes = p - reinterpret_cast<uint8_t *>(preallocateSpace);
|
||||
if (neededBytes > preallocateSize) {
|
||||
output->stop();
|
||||
audioLogger->printf_P("OOM error in MP3: Want %d bytes, have %d bytes preallocated.\n", neededBytes, preallocateSize);
|
||||
return false;
|
||||
}
|
||||
|
@ -336,6 +338,9 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output)
|
|||
stream = NULL;
|
||||
frame = NULL;
|
||||
synth = NULL;
|
||||
|
||||
output->stop();
|
||||
audioLogger->printf_P("OOM error in MP3\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -413,4 +418,3 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -236,13 +236,13 @@ bool AudioGeneratorRTTTL::GetNextNote()
|
|||
ptr++;
|
||||
note++;
|
||||
}
|
||||
if (!ReadInt(&scale)) {
|
||||
scale = defaultOctave;
|
||||
}
|
||||
if ((ptr < len) && (buff[ptr] == '.')) {
|
||||
ptr++;
|
||||
dur += dur / 2;
|
||||
}
|
||||
if (!ReadInt(&scale)) {
|
||||
scale = defaultOctave;
|
||||
}
|
||||
// Eat any trailing whitespace and comma
|
||||
SkipWhitespace();
|
||||
if ((ptr < len) && (buff[ptr]==',')) {
|
||||
|
|
Loading…
Reference in New Issue