summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraghavendra <raghavendra.rao@collabora.com>2020-09-25 22:00:26 +0530
committerTim-Philipp Müller <tim@centricular.com>2020-10-11 10:54:17 +0100
commit0e4057ad1b4158453f0ef1a4b0abe4ffd0754cfd (patch)
treeb1a017a65c336260ebb81b5a64c8538e2f414f01
parent83856c25bfda34489dec85b213e7203a77272007 (diff)
srtobject: typecast SRTO_LINGER to linger
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1675>
-rw-r--r--ext/srt/gstsrtobject.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/srt/gstsrtobject.c b/ext/srt/gstsrtobject.c
index ec4591975..0ccdb2fa7 100644
--- a/ext/srt/gstsrtobject.c
+++ b/ext/srt/gstsrtobject.c
@@ -118,7 +118,6 @@ struct srt_constant_params
static struct srt_constant_params srt_params[] = {
{"SRTO_SNDSYN", SRTO_SNDSYN, 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 */
{NULL, -1, -1},
};
@@ -181,6 +180,7 @@ gst_srt_object_set_common_params (SRTSOCKET sock, GstSRTObject * srtobject,
{
struct srt_constant_params *params = srt_params;
const gchar *passphrase;
+ struct linger linger = { 0 };
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");
if (passphrase != NULL && passphrase[0] != '\0') {
gint pbkeylen;