Redo the last packet handling of the MP3 decoder (#266)
Keep track of how many values are actually good in the buffer (before it was always guaranteed to be the full size) and when EOF is detected, only shift out valid, good bytes, and return STOP when the unused bytes are 0 or unchanged from the last pass. Fixes #265
This commit is contained in:
1 parent
1fde10daa0
commit
b7cb0ee8e2
2 files changed
+9
-11
No files matched your search
@@ -43,9 +43,9 @@ class AudioGeneratorMP3 : public AudioGenerator
|
||||
const int buffLen = 0x600; // Slightly larger than largest MP3 frame
|
||||
unsigned char *buff;
|
||||
int lastReadPos;
|
||||
int lastBuffLen;
|
||||
unsigned int lastRate;
|
||||
int lastChannels;
|
||||
bool finishing;
|
||||
|
||||
// Decoding bits
|
||||
bool madInitted;
|
||||
|
||||
Reference in new issue
Block a user