audio: pipewire: Block while waiting on stream state info

Initializing streams, particularly capture streams, can take many milliseconds, which is a bit much for a busy wait.  Use a blocking wait instead.
This commit is contained in:
Frank Praznik
2021-03-28 17:45:41 -04:00
committed by Sam Lantinga
parent 8deb406300
commit 5f9effaa7e
2 changed files with 31 additions and 12 deletions

View File

@@ -37,8 +37,9 @@ struct SDL_PrivateAudioData
struct pw_context *context;
struct SDL_DataQueue *buffer;
size_t buffer_period_size;
Sint32 stride; /* Bytes-per-frame */
size_t buffer_period_size;
Sint32 stride; /* Bytes-per-frame */
SDL_atomic_t stream_initialized;
};
#endif /* SDL_pipewire_h_ */