Commit graph

7 commits

Author SHA1 Message Date
Barnabás Pőcze
2ba9881b4d pulse-server: pending-sample: handle client disconnection correctly
Previously, a client disconnecting while a sample was playing could
lead to issues. For example, if a client disconnected before the
"ready" signal of the sample-play arrives, `operation_new_cb()`
would be called and that would try to use the client's pw_manager,
however, that has previously been destroyed in `client_disconnect()`.

If the client disconnected after the "ready" signal but before the reply
has been sent, then `sample_play_ready_reply()` would never be called
since operations are completed via the client's pw_manager which
would already be destroyed at that point.

Fix this by installing a listener on the client, and properly
cancelling the operation and making sure that the pending_sample
is correctly destroyed.
2023-05-10 18:57:20 +00:00
Barnabás Pőcze
dd7c47bb3d pulse-server: pending-sample: rename ready to replied
Rename `pending_sample::ready` to `pending_sample::replied` because
it is set when a reply is sent, not when the ready signal comes.
2023-05-10 18:57:20 +00:00
Barnabás Pőcze
e37da42632 pulse-server: move sample playing into pending-sample.c 2023-05-10 18:57:20 +00:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
0475adbd35 pulse-server: wait for pending_sample to complete
Wait the reply to be sent and the sample to complete playback before
freeing the sample. Otherwise it might have been possible that the
sample completes before the reply can be sent.
2022-02-21 08:57:15 +01:00
Barnabás Pőcze
29a288ebae pulse-server: pending-sample: remove done flag
The `done` member of the `pending_sample` struct is only ever
set, but never read. Remove it.
2022-02-02 15:40:43 +00:00
Barnabás Pőcze
8a0f52ab78 pulse-server: split out pending-sample
Part of !776.
2021-06-25 03:23:15 +02:00