sctp: Convert function to avoid aggregate return
It's only used locally and only to fill an existing variable Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
This commit is contained in:
parent
7b17c198d7
commit
e68f99688f
@ -110,8 +110,8 @@ static void gst_sctp_association_get_property (GObject * object, guint prop_id,
|
|||||||
|
|
||||||
static struct socket *create_sctp_socket (GstSctpAssociation *
|
static struct socket *create_sctp_socket (GstSctpAssociation *
|
||||||
gst_sctp_association);
|
gst_sctp_association);
|
||||||
static struct sockaddr_conn get_sctp_socket_address (GstSctpAssociation *
|
static void fill_sctp_socket_address (GstSctpAssociation * gst_sctp_association,
|
||||||
gst_sctp_association, guint16 port);
|
guint16 port, struct sockaddr_conn *addr);
|
||||||
static gboolean client_role_connect (GstSctpAssociation * self);
|
static gboolean client_role_connect (GstSctpAssociation * self);
|
||||||
static int sctp_packet_out (void *addr, void *buffer, size_t length, guint8 tos,
|
static int sctp_packet_out (void *addr, void *buffer, size_t length, guint8 tos,
|
||||||
guint8 set_df);
|
guint8 set_df);
|
||||||
@ -486,7 +486,7 @@ gst_sctp_association_send_data (GstSctpAssociation * self, const guint8 * buf,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
remote_addr = get_sctp_socket_address (self, self->remote_port);
|
fill_sctp_socket_address (self, self->remote_port, &remote_addr);
|
||||||
g_mutex_unlock (&self->association_mutex);
|
g_mutex_unlock (&self->association_mutex);
|
||||||
|
|
||||||
/* TODO: We probably want to split too large chunks into multiple packets
|
/* TODO: We probably want to split too large chunks into multiple packets
|
||||||
@ -688,21 +688,17 @@ error:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sockaddr_conn
|
static void
|
||||||
get_sctp_socket_address (GstSctpAssociation * gst_sctp_association,
|
fill_sctp_socket_address (GstSctpAssociation * gst_sctp_association,
|
||||||
guint16 port)
|
guint16 port, struct sockaddr_conn *addr)
|
||||||
{
|
{
|
||||||
struct sockaddr_conn addr;
|
memset ((void *) addr, 0, sizeof (struct sockaddr_conn));
|
||||||
|
|
||||||
memset ((void *) &addr, 0, sizeof (struct sockaddr_conn));
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
addr.sconn_len = sizeof (struct sockaddr_conn);
|
addr->sconn_len = sizeof (struct sockaddr_conn);
|
||||||
#endif
|
#endif
|
||||||
addr.sconn_family = AF_CONN;
|
addr->sconn_family = AF_CONN;
|
||||||
addr.sconn_port = g_htons (port);
|
addr->sconn_port = g_htons (port);
|
||||||
addr.sconn_addr = (void *) gst_sctp_association;
|
addr->sconn_addr = (void *) gst_sctp_association;
|
||||||
|
|
||||||
return addr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -714,8 +710,8 @@ client_role_connect (GstSctpAssociation * self)
|
|||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->association_mutex);
|
g_mutex_lock (&self->association_mutex);
|
||||||
local_addr = get_sctp_socket_address (self, self->local_port);
|
fill_sctp_socket_address (self, self->local_port, &local_addr);
|
||||||
remote_addr = get_sctp_socket_address (self, self->remote_port);
|
fill_sctp_socket_address (self, self->remote_port, &remote_addr);
|
||||||
g_mutex_unlock (&self->association_mutex);
|
g_mutex_unlock (&self->association_mutex);
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user