From 5f482b287ea019c2ebb60541bb737cd922233e07 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 Oct 2020 10:42:29 +0200 Subject: [PATCH] pulse: first signal READY, then cork if still needed --- pipewire-pulseaudio/src/stream.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pipewire-pulseaudio/src/stream.c b/pipewire-pulseaudio/src/stream.c index 5a6814731..db601e7e9 100644 --- a/pipewire-pulseaudio/src/stream.c +++ b/pipewire-pulseaudio/src/stream.c @@ -254,15 +254,17 @@ static void stream_param_changed(void *data, uint32_t id, const struct spa_pod * pa_format_info_free(s->format); s->format = pa_format_info_from_sample_spec(&s->sample_spec, &s->channel_map); if (s->format == NULL) { - pw_stream_set_error(s->stream, res, "unhandled format"); + pw_stream_set_error(s->stream, -errno, "unhandled format"); return; } + patch_buffer_attr(s, &s->buffer_attr, &s->flags); + + pa_stream_set_state(s, PA_STREAM_READY); + if (s->corked) pw_stream_set_active(s->stream, false); - patch_buffer_attr(s, &s->buffer_attr, &s->flags); - stride = pa_frame_size(&s->sample_spec); if (s->direction == PA_STREAM_RECORD) { @@ -276,8 +278,6 @@ static void stream_param_changed(void *data, uint32_t id, const struct spa_pod * params[n_params++] = get_buffers_param(s, &s->buffer_attr, &b); pw_stream_update_params(s->stream, params, n_params); - - pa_stream_set_state(s, PA_STREAM_READY); } static void stream_control_info(void *data, uint32_t id, const struct pw_stream_control *control)