mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
protocol-pulse: flush streams on pause
To remove any lingering data
This commit is contained in:
parent
ba18768246
commit
33653cbabf
1 changed files with 15 additions and 1 deletions
|
|
@ -166,10 +166,24 @@ static void on_in_stream_state_changed(void *d, enum pw_stream_state old,
|
||||||
{
|
{
|
||||||
struct module_combine_sink_data *data = d;
|
struct module_combine_sink_data *data = d;
|
||||||
struct module *module = data->module;
|
struct module *module = data->module;
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
if (state == PW_STREAM_STATE_UNCONNECTED) {
|
switch (state) {
|
||||||
|
case PW_STREAM_STATE_PAUSED:
|
||||||
|
pw_stream_flush(data->sink, false);
|
||||||
|
for (i = 0; i < MAX_SINKS; i++) {
|
||||||
|
struct combine_stream *s = &data->streams[i];
|
||||||
|
if (s->stream == NULL || s->cleanup)
|
||||||
|
continue;
|
||||||
|
pw_stream_flush(s->stream, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PW_STREAM_STATE_UNCONNECTED:
|
||||||
pw_log_info("stream disconnected, unloading");
|
pw_log_info("stream disconnected, unloading");
|
||||||
module_schedule_unload(module);
|
module_schedule_unload(module);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue