output/pipewire: un-inline StateChanged()

This commit is contained in:
Max Kellermann 2021-08-05 10:47:45 +02:00
parent 4d1ce7023b
commit b838bf3109

View File

@ -87,13 +87,7 @@ private:
} }
void StateChanged(enum pw_stream_state state, void StateChanged(enum pw_stream_state state,
[[maybe_unused]] const char *error) noexcept { const char *error) noexcept;
const bool was_disconnected = disconnected;
disconnected = state == PW_STREAM_STATE_ERROR ||
state == PW_STREAM_STATE_UNCONNECTED;
if (!was_disconnected && disconnected)
pw_thread_loop_signal(thread_loop, false);
}
static void StateChanged(void *data, static void StateChanged(void *data,
[[maybe_unused]] enum pw_stream_state old, [[maybe_unused]] enum pw_stream_state old,
@ -344,6 +338,17 @@ PipeWireOutput::Close() noexcept
delete ring_buffer; delete ring_buffer;
} }
inline void
PipeWireOutput::StateChanged(enum pw_stream_state state,
[[maybe_unused]] const char *error) noexcept
{
const bool was_disconnected = disconnected;
disconnected = state == PW_STREAM_STATE_ERROR ||
state == PW_STREAM_STATE_UNCONNECTED;
if (!was_disconnected && disconnected)
pw_thread_loop_signal(thread_loop, false);
}
inline void inline void
PipeWireOutput::Process() noexcept PipeWireOutput::Process() noexcept
{ {