@@ -38,6 +38,7 @@ class SnapClient {
3838 p_decoder = &decoder;
3939 p_output = &output_adapter;
4040 p_client = &client;
41+ server_ip.fromString (CONFIG_SNAPCAST_SERVER_HOST);
4142 }
4243
4344 SnapClient (Client &client, AudioStream &stream, StreamingDecoder &decoder,
@@ -48,13 +49,15 @@ class SnapClient {
4849 output_adapter.setStream (stream);
4950 p_output = &output_adapter;
5051 p_client = &client;
52+ server_ip.fromString (CONFIG_SNAPCAST_SERVER_HOST);
5153 }
5254
5355 SnapClient (Client &client, AudioOutput &output, AudioDecoder &decoder) {
5456 p_decoder = &decoder;
5557 p_output = &output;
5658 p_client = &client;
57- }
59+ server_ip.fromString (CONFIG_SNAPCAST_SERVER_HOST);
60+ }
5861
5962 SnapClient (Client &client, AudioOutput &output, StreamingDecoder &decoder,
6063 int bufferSize = CONFIG_STREAMIN_DECODER_BUFFER) {
@@ -73,7 +76,7 @@ class SnapClient {
7376
7477 // / @brief Defines the Snapcast Server IP address
7578 // / @param address
76- void setServerIP (IPAddress ipAddress) { this ->address = ipAddress; }
79+ void setServerIP (IPAddress ipAddress) { this ->server_ip = ipAddress; }
7780
7881 // / Defines the time synchronization logic
7982 void setSnapTimeSync (SnapTimeSync &timeSync){
@@ -111,7 +114,8 @@ class SnapClient {
111114 SnapTime::instance ().setupSNTPTime ();
112115#endif
113116
114- p_snapprocessor->setServerIP (address);
117+ p_snapprocessor->setServerIP (server_ip);
118+ p_snapprocessor->setServerPort (server_port);
115119 p_snapprocessor->setOutput (*p_output);
116120 p_snapprocessor->snapOutput ().setSnapTimeSync (*p_time_sync);
117121 p_snapprocessor->setDecoder (*p_decoder);
@@ -158,7 +162,8 @@ class SnapClient {
158162 AudioDecoder *p_decoder = nullptr ;
159163 Client *p_client = nullptr ;
160164 SnapTimeSync *p_time_sync = nullptr ;
161- IPAddress address;
165+ IPAddress server_ip;
166+ int server_port = CONFIG_SNAPCAST_SERVER_PORT;
162167
163168 void setupMDNS () {
164169#if CONFIG_SNAPCLIENT_USE_MDNS && defined(ESP32)
0 commit comments