Skip to content

Commit d8bebaa

Browse files
committed
make SnapMessageServerSettings class variable
1 parent 23908e5 commit d8bebaa

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- Use any output device or DSP chain suppored by the [Audio Tools](https://github.com/pschatzmann/arduino-audio-tools)
1515
- Flexible design so that you can choose from different processor implementations and synchronizers.
1616

17-
The disadvantage of these goals iw that you might need to fine tune the solution to have it working as you want.
17+
The disadvantage of these goals is, that you need to fine tune the solution to have it working as you want.
1818

1919
### Description
2020

src/api/SnapProcessor.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class SnapProcessor {
109109
codec_type codec_from_server = NO_CODEC;
110110
SnapMessageBase base_message;
111111
SnapMessageTime time_message;
112+
SnapMessageServerSettings server_settings_message;
112113
uint32_t client_state_muted = 0;
113114
char *start = nullptr;
114115
int size = 0;
@@ -142,6 +143,7 @@ class SnapProcessor {
142143
bool rc = true;
143144
while (rc) {
144145
rc = processMessageLoop();
146+
// some additional processing while we wait for data
145147
processExt();
146148
//logHeap();
147149
checkHeap();
@@ -150,13 +152,14 @@ class SnapProcessor {
150152
if (id_counter % 100 == 0) {
151153
logHeap();
152154
}
153-
checkHeap();
155+
// For rtos, give audio output some space
154156
delay(1);
155157
return true;
156158
}
157159

158160
/// additional processing
159161
virtual void processExt() {
162+
// For rtos, give audio output some space
160163
delay(5);
161164
}
162165

@@ -242,7 +245,7 @@ class SnapProcessor {
242245
hello_message.hostname = CONFIG_SNAPCAST_CLIENT_NAME;
243246
hello_message.version = "0.0.2";
244247
hello_message.client_name = "libsnapcast";
245-
hello_message.os = "esp32";
248+
hello_message.os = "arduino";
246249
hello_message.arch = "xtensa";
247250
hello_message.instance = 1;
248251
hello_message.id = mac_address;
@@ -421,11 +424,9 @@ class SnapProcessor {
421424

422425
bool processMessageServerSettings() {
423426
ESP_LOGD(TAG, "start");
424-
SnapMessageServerSettings server_settings_message;
425-
426427
// The first 4 bytes in the buffer are the size of the string.
427428
// We don't need this, so we'll shift the entire buffer over 4 bytes
428-
// and use the extra room to add a null character so cJSON can pares
429+
// and use the extra room to add a null character so we can pares
429430
// it.
430431
memmove(start, start + 4, size - 4);
431432
start[size - 3] = '\0';

0 commit comments

Comments
 (0)