|
@@ -976,18 +976,18 @@ static void initialize_spa_info(const SDL_AudioSpec *spec, struct spa_audio_info
|
|
|
|
|
|
|
|
static Uint8 *PIPEWIRE_GetDeviceBuf(SDL_AudioDevice *device, int *buffer_size)
|
|
static Uint8 *PIPEWIRE_GetDeviceBuf(SDL_AudioDevice *device, int *buffer_size)
|
|
|
{
|
|
{
|
|
|
- // See if a buffer is available. If this returns NULL, SDL_PlaybackAudioThreadIterate will return false, but since we own the thread, it won't kill playback.
|
|
|
|
|
- // !!! FIXME: It's not clear to me if this ever returns NULL or if this was just defensive coding.
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // See if a buffer is available. If this sets *buffer_size=0, then SDL_PlaybackAudioThreadIterate will skip this iteration but try again next time.
|
|
|
struct pw_stream *stream = device->hidden->stream;
|
|
struct pw_stream *stream = device->hidden->stream;
|
|
|
struct pw_buffer *pw_buf = PIPEWIRE_pw_stream_dequeue_buffer(stream);
|
|
struct pw_buffer *pw_buf = PIPEWIRE_pw_stream_dequeue_buffer(stream);
|
|
|
if (pw_buf == NULL) {
|
|
if (pw_buf == NULL) {
|
|
|
|
|
+ *buffer_size = 0;
|
|
|
return NULL;
|
|
return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
struct spa_buffer *spa_buf = pw_buf->buffer;
|
|
struct spa_buffer *spa_buf = pw_buf->buffer;
|
|
|
if (spa_buf->datas[0].data == NULL) {
|
|
if (spa_buf->datas[0].data == NULL) {
|
|
|
PIPEWIRE_pw_stream_queue_buffer(stream, pw_buf);
|
|
PIPEWIRE_pw_stream_queue_buffer(stream, pw_buf);
|
|
|
|
|
+ *buffer_size = 0;
|
|
|
return NULL;
|
|
return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|