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:
1 parent
d923ebef36
commit
8e94702468
5 files changed
+29
-33
No files matched your search
@@ -209,13 +209,13 @@ void HandleStop(WiFiClient *client)
|
||||
RedirectToIndex(client);
|
||||
}
|
||||
|
||||
void MDCallback(void *cbData, const char *type, bool isUnicode, Stream *stream)
|
||||
void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string)
|
||||
{
|
||||
const char *ptr = reinterpret_cast<const char *>(cbData);
|
||||
(void) isUnicode; // Punt this ball for now
|
||||
(void) ptr;
|
||||
if (strstr(type, PSTR("Title"))) {
|
||||
strncpy(title, stream->readString().c_str(), sizeof(title));
|
||||
if (strstr_P(type, PSTR("Title"))) {
|
||||
strncpy_P(title, string, sizeof(title));
|
||||
title[sizeof(title)-1] = 0;
|
||||
} else {
|
||||
// Who knows what to do? Not me!
|
||||
|
||||
Reference in new issue
Block a user