diff options
Diffstat (limited to 'alc/backends/pipewire.cpp')
-rw-r--r-- | alc/backends/pipewire.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp index 41949a9b..ae6c81f8 100644 --- a/alc/backends/pipewire.cpp +++ b/alc/backends/pipewire.cpp @@ -1451,12 +1451,12 @@ bool PipeWirePlayback::reset() pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", mDevice->Frequency); MainloopUniqueLock plock{mLoop}; - static constexpr pw_stream_events streamEvents{CreateEvents()}; /* The stream takes overship of 'props', even in the case of failure. */ mStream = PwStreamPtr{pw_stream_new(mCore.get(), "Playback Stream", props)}; if(!mStream) throw al::backend_exception{al::backend_error::NoDevice, "Failed to create PipeWire stream (errno: %d)", errno}; + static constexpr pw_stream_events streamEvents{CreateEvents()}; pw_stream_add_listener(mStream.get(), &mStreamListener, &streamEvents, this); constexpr pw_stream_flags Flags{PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE @@ -1809,11 +1809,11 @@ void PipeWireCapture::open(const char *name) pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", mDevice->Frequency); MainloopUniqueLock plock{mLoop}; - static constexpr pw_stream_events streamEvents{CreateEvents()}; mStream = PwStreamPtr{pw_stream_new(mCore.get(), "Capture Stream", props)}; if(!mStream) throw al::backend_exception{al::backend_error::NoDevice, "Failed to create PipeWire stream (errno: %d)", errno}; + static constexpr pw_stream_events streamEvents{CreateEvents()}; pw_stream_add_listener(mStream.get(), &mStreamListener, &streamEvents, this); constexpr pw_stream_flags Flags{PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE |