mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: make method to pause/resume stream
Make a method to pause and resume a stream and keep track of the paused state of the stream. Use this function instead of setting the stream inactive/active so that we get nice logging for each state change.
This commit is contained in:
parent
4c3f56fca1
commit
fc159be9c6
3 changed files with 21 additions and 4 deletions
|
|
@ -207,6 +207,20 @@ uint32_t stream_pop_missing(struct stream *stream)
|
|||
return missing;
|
||||
}
|
||||
|
||||
void stream_set_paused(struct stream *stream, bool paused, const char *reason)
|
||||
{
|
||||
if (stream->is_paused == paused)
|
||||
return;
|
||||
|
||||
if (reason && stream->client)
|
||||
pw_log_info("%p: [%s] %s because of %s",
|
||||
stream, stream->client->name,
|
||||
paused ? "paused" : "resumed", reason);
|
||||
|
||||
stream->is_paused = paused;
|
||||
pw_stream_set_active(stream->stream, !paused);
|
||||
}
|
||||
|
||||
int stream_send_underflow(struct stream *stream, int64_t offset)
|
||||
{
|
||||
struct client *client = stream->client;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue