diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index d10cac5d3..203bdf214 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "gstpipewireformat.h" @@ -735,7 +736,7 @@ gst_pipewire_sink_open (GstPipeWireSink * pwsink) if (pwsink->fd == -1) pw_remote_connect (pwsink->remote); else - pw_remote_connect_fd (pwsink->remote, pwsink->fd); + pw_remote_connect_fd (pwsink->remote, dup(pwsink->fd)); while (TRUE) { enum pw_remote_state state = pw_remote_get_state (pwsink->remote, &error); diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index 77d43c9d9..5981cc181 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -1002,7 +1002,7 @@ gst_pipewire_src_open (GstPipeWireSrc * pwsrc) if (pwsrc->fd == -1) pw_remote_connect (pwsrc->remote); else - pw_remote_connect_fd (pwsrc->remote, pwsrc->fd); + pw_remote_connect_fd (pwsrc->remote, dup(pwsrc->fd)); while (TRUE) { enum pw_remote_state state = pw_remote_get_state(pwsrc->remote, &error); diff --git a/src/pipewire/remote.c b/src/pipewire/remote.c index 472b26845..f878ca487 100644 --- a/src/pipewire/remote.c +++ b/src/pipewire/remote.c @@ -428,7 +428,7 @@ int pw_remote_connect_fd(struct pw_remote *remote, int fd) pw_remote_update_state(remote, PW_REMOTE_STATE_CONNECTING, NULL); - if ((res = pw_protocol_client_connect_fd(remote->conn, fd, false)) < 0) { + if ((res = pw_protocol_client_connect_fd(remote->conn, fd, true)) < 0) { pw_remote_update_state(remote, PW_REMOTE_STATE_ERROR, "connect_fd failed %s", spa_strerror(res)); return res; diff --git a/src/pipewire/remote.h b/src/pipewire/remote.h index 2974a04ae..b0e929f2c 100644 --- a/src/pipewire/remote.h +++ b/src/pipewire/remote.h @@ -177,7 +177,7 @@ void pw_remote_add_listener(struct pw_remote *remote, int pw_remote_connect(struct pw_remote *remote); /** Connect to a remote PipeWire on the given socket \memberof pw_remote - * \param fd the connected socket to use, the socket will not be closed + * \param fd the connected socket to use, the socket will be closed * automatically on disconnect or error. * \return 0 on success, < 0 on error */ int pw_remote_connect_fd(struct pw_remote *remote, int fd);