Replace Stream with simple string in MD callback

@armSeb found that the stream interface caused a big slowdown and
hiccups in his playback, replace the MetadataCallback's *Stream with
a simple *char for faster operation and less overhead.
This commit is contained in:
Earle F. Philhower, III committed 2017-12-15 12:54:49 -08:00
1 parent d923ebef36
commit 8e94702468
5 files changed
+29 -33

No files matched your search

+1 -8
View File
@@ -19,8 +19,6 @@
*/
#include "AudioFileSourceICYStream.h"
#include "AudioFileSourcePROGMEM.h"
#include "AudioFileStream.h"
AudioFileSourceICYStream::AudioFileSourceICYStream()
{
@@ -209,18 +207,13 @@ retry:
if (d==';') { mdr.unread(d); break; }
else { mdr.unread(d); }
}
// if ((c=='\n') || (c=='\r') || (c==' ') || (c=='\t') || (c==0)) continue; // Throw away any whitespace
*(p++) = c;
}
if (c != '\'') {
// MD data was too long, read and throw away rest
while ((c != '\'') && !mdr.eof()) mdr.read(&c, 1);
}
{
AudioFileSourcePROGMEM afsp(value, strlen(value));
AudioFileStream afs(&afsp, strlen(value));
cb.md(type, false, &afs);
}
cb.md(type, false, value);
do {
ret = mdr.read(&c, 1);
} while ((c !=';') && (c!=0) && !mdr.eof());