srtobject: typecast SRTO_LINGER to linger

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1615>
This commit is contained in:
raghavendra 2020-09-25 22:00:26 +05:30
parent d90e353daa
commit 84f8dbd932

View file

@ -118,7 +118,6 @@ struct srt_constant_params
static struct srt_constant_params srt_params[] = { static struct srt_constant_params srt_params[] = {
{"SRTO_SNDSYN", SRTO_SNDSYN, 0}, /* 0: non-blocking */ {"SRTO_SNDSYN", SRTO_SNDSYN, 0}, /* 0: non-blocking */
{"SRTO_RCVSYN", SRTO_RCVSYN, 0}, /* 0: non-blocking */ {"SRTO_RCVSYN", SRTO_RCVSYN, 0}, /* 0: non-blocking */
{"SRTO_LINGER", SRTO_LINGER, 0},
{"SRTO_TSBPMODE", SRTO_TSBPDMODE, 1}, /* Timestamp-based Packet Delivery mode must be enabled */ {"SRTO_TSBPMODE", SRTO_TSBPDMODE, 1}, /* Timestamp-based Packet Delivery mode must be enabled */
{NULL, -1, -1}, {NULL, -1, -1},
}; };
@ -181,6 +180,7 @@ gst_srt_object_set_common_params (SRTSOCKET sock, GstSRTObject * srtobject,
{ {
struct srt_constant_params *params = srt_params; struct srt_constant_params *params = srt_params;
const gchar *passphrase; const gchar *passphrase;
struct linger linger = { 0 };
GST_OBJECT_LOCK (srtobject->element); GST_OBJECT_LOCK (srtobject->element);
@ -193,6 +193,14 @@ gst_srt_object_set_common_params (SRTSOCKET sock, GstSRTObject * srtobject,
} }
} }
linger.l_onoff = 0; /* 0: non-blocking */
if (srt_setsockopt (sock, 0, SRTO_LINGER, (const char *) &linger,
sizeof (linger))) {
g_set_error (error, GST_LIBRARY_ERROR, GST_LIBRARY_ERROR_SETTINGS,
"failed to set SRTO_LINGER (reason: %s)", srt_getlasterror_str ());
goto err;
}
passphrase = gst_structure_get_string (srtobject->parameters, "passphrase"); passphrase = gst_structure_get_string (srtobject->parameters, "passphrase");
if (passphrase != NULL && passphrase[0] != '\0') { if (passphrase != NULL && passphrase[0] != '\0') {
gint pbkeylen; gint pbkeylen;