Skip to content

Commit

Permalink
Fix an audio lock bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaughan committed Sep 14, 2023
1 parent f805886 commit 8a77dd8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ void demo_tick()
}
}
}

// Unlock the audio, since we are fully loaded now.
ctx.audioTickEnableMutex.unlock();
}
}
Expand Down
2 changes: 1 addition & 1 deletion libs/zest
5 changes: 5 additions & 0 deletions src/audio/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ void audio_destroy()
{
auto& ctx = audioContext;

// Unlock the audio, since we are fully loaded now.
ctx.audioTickEnableMutex.lock();

// Stop the analysis
audio_analysis_destroy_all();

Expand All @@ -686,6 +689,8 @@ void audio_destroy()
sp_destroy(&ctx.pSP);
ctx.pSP = nullptr;
}

ctx.audioTickEnableMutex.unlock();
}

void audio_add_settings_hooks()
Expand Down

0 comments on commit 8a77dd8

Please sign in to comment.