From 84f8dbd932029220ee86154dd85b241911ea3891 Mon Sep 17 00:00:00 2001 From: raghavendra Date: Fri, 25 Sep 2020 22:00:26 +0530 Subject: [PATCH] srtobject: typecast SRTO_LINGER to linger Part-of: --- ext/srt/gstsrtobject.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/srt/gstsrtobject.c b/ext/srt/gstsrtobject.c index ec45919751..0ccdb2fa7e 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;