Fix warnings and off-by-one in AAC
This commit is contained in:
1 parent
93f7d90baf
commit
e8e7acb884
7 files changed
+11
-4
No files matched your search
@@ -117,7 +117,7 @@ bool AudioGeneratorAAC::FillBufferWithValidFrame()
|
|||||||
if (nextSync >= 0) nextSync += lastFrameEnd;
|
if (nextSync >= 0) nextSync += lastFrameEnd;
|
||||||
lastFrameEnd = 0;
|
lastFrameEnd = 0;
|
||||||
if (nextSync == -1) {
|
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;
|
buff[0] = 0xff;
|
||||||
buffValid = file->read(buff+1, buffLen-1);
|
buffValid = file->read(buff+1, buffLen-1);
|
||||||
if (buffValid==0) return false; // No data available, EOF
|
if (buffValid==0) return false; // No data available, EOF
|
||||||
|
|||||||
@@ -336,6 +336,9 @@ extern "C" {
|
|||||||
#else
|
#else
|
||||||
void stack(const char *s, const char *t, int i)
|
void stack(const char *s, const char *t, int i)
|
||||||
{
|
{
|
||||||
|
(void) s;
|
||||||
|
(void) t;
|
||||||
|
(void) i;
|
||||||
}
|
}
|
||||||
int stackfree()
|
int stackfree()
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ extern "C" {
|
|||||||
# endif
|
# endif
|
||||||
extern int stackfree();
|
extern int stackfree();
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
};
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Define to enable experimental code. */
|
/* Define to enable experimental code. */
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ void mad_frame_init(struct mad_frame *frame)
|
|||||||
*/
|
*/
|
||||||
void mad_frame_finish(struct mad_frame *frame)
|
void mad_frame_finish(struct mad_frame *frame)
|
||||||
{
|
{
|
||||||
|
(void) frame;
|
||||||
mad_header_finish(&frame->header);
|
mad_header_finish(&frame->header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ stack(__FUNCTION__, __FILE__, __LINE__);
|
|||||||
void mad_stream_finish(struct mad_stream *stream)
|
void mad_stream_finish(struct mad_stream *stream)
|
||||||
{
|
{
|
||||||
stack(__FUNCTION__, __FILE__, __LINE__);
|
stack(__FUNCTION__, __FILE__, __LINE__);
|
||||||
|
(void) stream;
|
||||||
|
|
||||||
mad_bit_finish(&stream->anc_ptr);
|
mad_bit_finish(&stream->anc_ptr);
|
||||||
mad_bit_finish(&stream->ptr);
|
mad_bit_finish(&stream->ptr);
|
||||||
|
|||||||
+2
-2
@@ -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
|
../../src/libflac/stream_decoder.c ../../src/libflac/float.c
|
||||||
|
|
||||||
|
|
||||||
CCOPTS=-g -Wall -m32 -include Arduino.h
|
CCOPTS=-g -Wunused-parameter -Wall -m32 -include Arduino.h
|
||||||
CPPOPTS=-g -Wall -std=c++11 -m32 -include Arduino.h
|
CPPOPTS=-g -Wunused-parameter -Wall -std=c++11 -m32 -include Arduino.h
|
||||||
|
|
||||||
mp3: FORCE
|
mp3: FORCE
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
|||||||
@@ -20,4 +20,6 @@ int main(int argc, char **argv)
|
|||||||
delete aac;
|
delete aac;
|
||||||
delete out;
|
delete out;
|
||||||
delete in;
|
delete in;
|
||||||
|
|
||||||
|
free(space);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user