screencast: move xdpw_pwr_stream_destroy() up

- keep the order of functions in-sync with the header
This commit is contained in:
Tobias Jakobi 2021-05-22 19:31:52 +02:00 committed by Simon Ser
parent f60bdcef71
commit 0d23a5ea15

View file

@ -206,6 +206,18 @@ void xdpw_pwr_stream_create(struct xdpw_screencast_instance *cast) {
&param, 1); &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) { int xdpw_pwr_context_create(struct xdpw_state *state) {
struct xdpw_screencast_context *ctx = &state->screencast; struct xdpw_screencast_context *ctx = &state->screencast;
@ -244,15 +256,3 @@ void xdpw_pwr_context_destroy(struct xdpw_state *state) {
ctx->pwr_context = NULL; 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;
}