Skip to content

Commit fc04d11

Browse files
committed
Use the drained callback on the playback stream
This may be more correct than using the "paused" event.
1 parent 25b2456 commit fc04d11

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pipewire/qubes-pw-module.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,8 @@ static void stream_state_changed(void *data, enum pw_stream_state old,
10161016
return;
10171017
case PW_STREAM_STATE_PAUSED:
10181018
pw_log_debug("%s paused", name);
1019-
set_stream_state(stream, false);
1019+
if (!qubes_stream_is_playback(stream))
1020+
set_stream_state(stream, false);
10201021
break;
10211022
case PW_STREAM_STATE_STREAMING:
10221023
pw_log_debug("%s streaming", name);
@@ -1268,6 +1269,11 @@ static void stream_param_changed(void *data, uint32_t id, const struct spa_pod *
12681269
}
12691270
}
12701271

1272+
static void playback_stream_drained(void *data)
1273+
{
1274+
set_stream_state(data, false);
1275+
}
1276+
12711277
static const struct pw_stream_events capture_stream_events = {
12721278
.version = PW_VERSION_STREAM_EVENTS,
12731279
.destroy = stream_destroy,
@@ -1290,6 +1296,7 @@ static const struct pw_stream_events playback_stream_events = {
12901296
.add_buffer = NULL,
12911297
.remove_buffer = NULL,
12921298
.process = playback_stream_process,
1299+
.drained = playback_stream_drained,
12931300
};
12941301

12951302
static void core_error(void *data, uint32_t id, int seq, int res, const char *message)

0 commit comments

Comments
 (0)