Fix warnings and off-by-one in AAC

This commit is contained in:
Earle F. Philhower, III committed 2018-01-21 19:27:07 -08:00
1 parent 93f7d90baf
commit e8e7acb884
7 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ bool AudioGeneratorAAC::FillBufferWithValidFrame()
if (nextSync >= 0) nextSync += lastFrameEnd;
lastFrameEnd = 0;
if (nextSync == -1) {
if (buff[buffValid-1]==0xff) { // Could be 1st half of syncword, preserve it...
if (buffValid && buff[buffValid-1]==0xff) { // Could be 1st half of syncword, preserve it...
buff[0] = 0xff;
buffValid = file->read(buff+1, buffLen-1);
if (buffValid==0) return false; // No data available, EOF
+3
View File
@@ -336,6 +336,9 @@ extern "C" {
#else
void stack(const char *s, const char *t, int i)
{
(void) s;
(void) t;
(void) i;
}
int stackfree()
{
+1 -1
View File
@@ -13,7 +13,7 @@ extern "C" {
# endif
extern int stackfree();
# ifdef __cplusplus
};
}
# endif
/* Define to enable experimental code. */
+1
View File
@@ -104,6 +104,7 @@ void mad_frame_init(struct mad_frame *frame)
*/
void mad_frame_finish(struct mad_frame *frame)
{
(void) frame;
mad_header_finish(&frame->header);
}
+1
View File
@@ -65,6 +65,7 @@ stack(__FUNCTION__, __FILE__, __LINE__);
void mad_stream_finish(struct mad_stream *stream)
{
stack(__FUNCTION__, __FILE__, __LINE__);
(void) stream;
mad_bit_finish(&stream->anc_ptr);
mad_bit_finish(&stream->ptr);
+2 -2
View File
@@ -28,8 +28,8 @@ libflac=../../src/libflac/md5.c ../../src/libflac/window.c ../../src/libflac/mem
../../src/libflac/stream_decoder.c ../../src/libflac/float.c
CCOPTS=-g -Wall -m32 -include Arduino.h
CPPOPTS=-g -Wall -std=c++11 -m32 -include Arduino.h
CCOPTS=-g -Wunused-parameter -Wall -m32 -include Arduino.h
CPPOPTS=-g -Wunused-parameter -Wall -std=c++11 -m32 -include Arduino.h
mp3: FORCE
rm -f *.o
+2
View File
@@ -20,4 +20,6 @@ int main(int argc, char **argv)
delete aac;
delete out;
delete in;
free(space);
}