From 0237296400458fa6281db92b37161c448ab91b98 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 17 Jan 2020 15:34:31 +0100 Subject: [PATCH] stream: don't set inactive on cork We don't pause our clock ticks in the corked state which confuses the timing code. As a workaround for now, don't set the node to inactive when corked, this still keeps calling into the process function and keep things moving. VLC seems to recover better. --- pipewire-pulseaudio/src/stream.c | 4 ++-- src/pipewire/stream.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pipewire-pulseaudio/src/stream.c b/pipewire-pulseaudio/src/stream.c index 70ffe02e2..ace01e46d 100644 --- a/pipewire-pulseaudio/src/stream.c +++ b/pipewire-pulseaudio/src/stream.c @@ -1537,8 +1537,8 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE); s->corked = b; - - pw_stream_set_active(s->stream, !b); + if (!b) + pw_stream_set_active(s->stream, true); o = pa_operation_new(s->context, s, on_success, sizeof(struct success_ack)); d = o->userdata; d->cb = cb; diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index d92399864..a7e38da83 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1417,9 +1417,6 @@ pw_stream_connect(struct pw_stream *stream, pw_impl_node_set_implementation(slave, &impl->impl_node); - if (!SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_INACTIVE)) - pw_impl_node_set_active(slave, true); - if (impl->media_type == SPA_MEDIA_TYPE_audio && impl->media_subtype == SPA_MEDIA_SUBTYPE_raw) { factory = pw_context_find_factory(impl->context, "adapter"); @@ -1442,6 +1439,8 @@ pw_stream_connect(struct pw_stream *stream, } else { impl->node = slave; } + if (!SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_INACTIVE)) + pw_impl_node_set_active(impl->node, true); pw_log_debug(NAME" %p: export node %p", stream, impl->node); stream->proxy = pw_core_export(stream->core,