Adjust timeout to 3 seconds

pull/300/head
James H Ball 2025-04-27 09:17:20 +01:00
commit 00a50f10ca
2 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -147,6 +147,10 @@ void VisualiserComponent::setFullScreen(bool fullScreen) {
this->fullScreen = fullScreen; this->fullScreen = fullScreen;
hideButtonRow = false; hideButtonRow = false;
setMouseCursor(juce::MouseCursor::PointingHandCursor); setMouseCursor(juce::MouseCursor::PointingHandCursor);
// Release renderingSemaphore to prevent deadlocks during layout changes
renderingSemaphore.release();
resized(); resized();
} }
@ -281,7 +285,10 @@ void VisualiserComponent::runTask(const std::vector<osci::Point>& points) {
// this just triggers a repaint // this just triggers a repaint
triggerAsyncUpdate(); triggerAsyncUpdate();
// wait for rendering on the OpenGLRenderer thread to complete // wait for rendering on the OpenGLRenderer thread to complete
renderingSemaphore.acquire(); if (!renderingSemaphore.acquire()) {
// If acquire times out, log a message or handle it as appropriate
juce::Logger::writeToLog("Rendering semaphore acquisition timed out");
}
} }
int VisualiserComponent::prepareTask(double sampleRate, int bufferSize) { int VisualiserComponent::prepareTask(double sampleRate, int bufferSize) {
@ -388,6 +395,9 @@ void VisualiserComponent::setRecording(bool recording) {
bool stillRecording = audioRecorder.isRecording(); bool stillRecording = audioRecorder.isRecording();
#endif #endif
// Release renderingSemaphore to prevent deadlock
renderingSemaphore.release();
if (recording) { if (recording) {
#if OSCI_PREMIUM #if OSCI_PREMIUM
recordingVideo = recordingSettings.recordingVideo(); recordingVideo = recordingSettings.recordingVideo();
@ -601,6 +611,10 @@ void VisualiserComponent::popoutWindow() {
} }
#endif #endif
setRecording(false); setRecording(false);
// Release renderingSemaphore to prevent deadlock when creating a child visualizer
renderingSemaphore.release();
auto visualiser = new VisualiserComponent( auto visualiser = new VisualiserComponent(
audioProcessor, audioProcessor,
editor, editor,
@ -950,6 +964,9 @@ Texture VisualiserComponent::makeTexture(int width, int height, GLuint textureID
void VisualiserComponent::setResolution(int width) { void VisualiserComponent::setResolution(int width) {
using namespace juce::gl; using namespace juce::gl;
// Release semaphore to prevent deadlocks during texture rebuilding
renderingSemaphore.release();
glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer); glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
lineTexture = makeTexture(width, width, lineTexture.id); lineTexture = makeTexture(width, width, lineTexture.id);

@ -1 +1 @@
Subproject commit d089b78b1e1e16d6b6173cba6f4202a87e05b0ba Subproject commit cf124cc5de4d9857c7633e9c03117f20e1550e81