Skip to content

Commit

Permalink
screencast: move xdpw_pwr_stream_destroy() up
Browse files Browse the repository at this point in the history
- keep the order of functions in-sync with the header
  • Loading branch information
tobiasjakobi authored and emersion committed May 24, 2021
1 parent f60bdce commit 0d23a5e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/screencast/pipewire_screencast.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ void xdpw_pwr_stream_create(struct xdpw_screencast_instance *cast) {
&param, 1);
}

void xdpw_pwr_stream_destroy(struct xdpw_screencast_instance *cast) {
if (!cast->stream) {
return;
}

logprint(DEBUG, "pipewire: destroying stream");
pw_stream_flush(cast->stream, false);
pw_stream_disconnect(cast->stream);
pw_stream_destroy(cast->stream);
cast->stream = NULL;
}

int xdpw_pwr_context_create(struct xdpw_state *state) {
struct xdpw_screencast_context *ctx = &state->screencast;

Expand Down Expand Up @@ -244,15 +256,3 @@ void xdpw_pwr_context_destroy(struct xdpw_state *state) {
ctx->pwr_context = NULL;
}
}

void xdpw_pwr_stream_destroy(struct xdpw_screencast_instance *cast) {
if (!cast->stream) {
return;
}

logprint(DEBUG, "pipewire: destroying stream");
pw_stream_flush(cast->stream, false);
pw_stream_disconnect(cast->stream);
pw_stream_destroy(cast->stream);
cast->stream = NULL;
}

0 comments on commit 0d23a5e

Please sign in to comment.