mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
remote: always close the fd in connect_fd
Not closing the fd causes leaks in existing apps. It's probably better to always close it and let apps deal with that by using dup or similar. Make gst sink and source dup the fd before connect_fd(). Fixes #181
This commit is contained in:
parent
ddd2a97f7e
commit
c9855763c3
4 changed files with 5 additions and 4 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "gstpipewireformat.h"
|
||||
|
|
@ -738,7 +739,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);
|
||||
|
|
|
|||
|
|
@ -984,7 +984,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue