Browse Source

display race condition fix - release

philippe44 5 years ago
parent
commit
a43ee25033
1 changed files with 6 additions and 1 deletions
  1. 6 1
      components/squeezelite/display.c

+ 6 - 1
components/squeezelite/display.c

@@ -331,10 +331,15 @@ static void send_server(void) {
  */
 static void server(in_addr_t ip, u16_t hport, u16_t cport) {
 	char msg[32];
+	
+	xSemaphoreTake(displayer.mutex, portMAX_DELAY);
+	
 	sprintf(msg, "%s:%hu", inet_ntoa(ip), hport);
 	if (displayer.owned) GDS_TextPos(display, GDS_FONT_DEFAULT, GDS_TEXT_CENTERED, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, msg);
 	SETD_width = displayer.width;
-	displayer.dirty = true;
+	
+	xSemaphoreGive(displayer.mutex);
+	
 	if (notify_chain) (*notify_chain)(ip, hport, cport);
 }