fix: use atomic operations for thread-safe clip state access

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-02 11:09:17 +00:00
parent 42ecd94d83
commit a8223baf43
3 changed files with 53 additions and 51 deletions

View File

@@ -32,9 +32,9 @@ typedef enum {
typedef struct {
ClipState state;
atomic_int state; // ClipState (atomic for thread-safe access)
float *buffer;
size_t buffer_size;
atomic_size_t buffer_size; // size_t (atomic for thread-safe access)
size_t write_position;
size_t read_position;
bool is_playing;