diff --git a/esp32_camera_mjpeg_multiclient.ino b/esp32_camera_mjpeg_multiclient.ino index 9a998d3..df49aa8 100644 --- a/esp32_camera_mjpeg_multiclient.ino +++ b/esp32_camera_mjpeg_multiclient.ino @@ -359,9 +359,10 @@ void handleJPG(void) WiFiClient client = server.client(); if (!client.connected()) return; - cam.run(); + xSemaphoreTake( frameSync, portMAX_DELAY ); client.write(JHEADER, jhdLen); - client.write((char*)cam.getfb(), cam.getSize()); + client.write((char*) camBuf, (size_t)camSize); + xSemaphoreGive( frameSync ); }