Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
srtobject: typecast SRTO_LINGER to linger
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavendra authored and justinjoy committed Oct 22, 2020
1 parent 4afa2b6 commit 6170df9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ext/srt/gstsrtobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ 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_TSBPDMODE", 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},
};

Expand Down Expand Up @@ -186,6 +185,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);

Expand All @@ -198,6 +198,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;
Expand Down

0 comments on commit 6170df9

Please sign in to comment.