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:
Wim Taymans 2022-11-20 15:07:44 +01:00
parent 4c3f56fca1
commit fc159be9c6
3 changed files with 21 additions and 4 deletions

View file

@ -115,6 +115,7 @@ struct stream {
unsigned int in_prebuf:1;
unsigned int killed:1;
unsigned int pending:1;
unsigned int is_paused:1;
};
struct stream *stream_new(struct client *client, enum stream_type type, uint32_t create_tag,
@ -124,6 +125,8 @@ void stream_free(struct stream *stream);
void stream_flush(struct stream *stream);
uint32_t stream_pop_missing(struct stream *stream);
void stream_set_paused(struct stream *stream, bool paused, const char *reason);
int stream_send_underflow(struct stream *stream, int64_t offset);
int stream_send_overflow(struct stream *stream);
int stream_send_killed(struct stream *stream);