Skip to content

Commit

Permalink
Use the drained callback on the playback stream
Browse files Browse the repository at this point in the history
This may be more correct than using the "paused" event.
  • Loading branch information
DemiMarie committed Feb 6, 2024
1 parent 25b2456 commit fc04d11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pipewire/qubes-pw-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,8 @@ static void stream_state_changed(void *data, enum pw_stream_state old,
return;
case PW_STREAM_STATE_PAUSED:
pw_log_debug("%s paused", name);
set_stream_state(stream, false);
if (!qubes_stream_is_playback(stream))
set_stream_state(stream, false);
break;
case PW_STREAM_STATE_STREAMING:
pw_log_debug("%s streaming", name);
Expand Down Expand Up @@ -1268,6 +1269,11 @@ static void stream_param_changed(void *data, uint32_t id, const struct spa_pod *
}
}

static void playback_stream_drained(void *data)
{
set_stream_state(data, false);
}

static const struct pw_stream_events capture_stream_events = {
.version = PW_VERSION_STREAM_EVENTS,
.destroy = stream_destroy,
Expand All @@ -1290,6 +1296,7 @@ static const struct pw_stream_events playback_stream_events = {
.add_buffer = NULL,
.remove_buffer = NULL,
.process = playback_stream_process,
.drained = playback_stream_drained,
};

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

0 comments on commit fc04d11

Please sign in to comment.