audio: pipewire: Condition variable doesn't need to be atomic

The condition variable is guarded by a mutex, so no need for it to be atomic.
main
Frank Praznik 2022-02-02 11:09:02 -05:00 committed by Ethan Lee
parent 0cb39ed468
commit 66866249a2
2 changed files with 5 additions and 5 deletions

View File

@ -1012,7 +1012,7 @@ stream_state_changed_callback(void *data, enum pw_stream_state old, enum pw_stre
_THIS = data; _THIS = data;
if (state == PW_STREAM_STATE_STREAMING || state == PW_STREAM_STATE_ERROR) { if (state == PW_STREAM_STATE_STREAMING || state == PW_STREAM_STATE_ERROR) {
SDL_AtomicSet(&this->hidden->stream_initialized, 1); this->hidden->stream_initialized = 1;
PIPEWIRE_pw_thread_loop_signal(this->hidden->loop, false); PIPEWIRE_pw_thread_loop_signal(this->hidden->loop, false);
} }
} }
@ -1167,7 +1167,7 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname)
/* Wait until the stream is either running or failed */ /* Wait until the stream is either running or failed */
PIPEWIRE_pw_thread_loop_lock(priv->loop); PIPEWIRE_pw_thread_loop_lock(priv->loop);
if (!SDL_AtomicGet(&priv->stream_initialized)) { if (!priv->stream_initialized) {
PIPEWIRE_pw_thread_loop_wait(priv->loop); PIPEWIRE_pw_thread_loop_wait(priv->loop);
} }
PIPEWIRE_pw_thread_loop_unlock(priv->loop); PIPEWIRE_pw_thread_loop_unlock(priv->loop);

View File

@ -39,7 +39,7 @@ struct SDL_PrivateAudioData
size_t buffer_period_size; size_t buffer_period_size;
Sint32 stride; /* Bytes-per-frame */ Sint32 stride; /* Bytes-per-frame */
SDL_atomic_t stream_initialized; int stream_initialized;
}; };
#endif /* SDL_pipewire_h_ */ #endif /* SDL_pipewire_h_ */