Reduce playlist packet size.

TODO: Implement!
This commit is contained in:
momo5502 2016-01-03 18:07:23 +01:00
parent 3c3eba8244
commit 0bbcff083b

View File

@ -36,11 +36,12 @@ namespace Components
Logger::Print("Received playlist request, sending currently stored buffer.\n"); Logger::Print("Received playlist request, sending currently stored buffer.\n");
// Split playlist data // Split playlist data
int maxPacketSize = 1000;
unsigned int maxBytes = Playlist::CurrentPlaylistBuffer.size(); unsigned int maxBytes = Playlist::CurrentPlaylistBuffer.size();
for (unsigned int i = 0; i < maxBytes; i += 2000) for (unsigned int i = 0; i < maxBytes; i += maxPacketSize)
{ {
unsigned int sendBytes = min(2000, maxBytes - i); unsigned int sendBytes = min(maxPacketSize, maxBytes - i);
unsigned int sentBytes = i + sendBytes; unsigned int sentBytes = i + sendBytes;
std::string data; std::string data;