srt: Set latency property on SRT socket

This commit is contained in:
Olivier Crête 2019-08-23 18:40:49 -04:00 committed by Nicolas Dufresne
parent 177f1f95e1
commit fa842f2156

View file

@ -162,6 +162,18 @@ gst_srt_object_set_common_params (SRTSOCKET sock, GstSRTObject * srtobject,
}
}
{
int latency;
if (!gst_structure_get_int (srtobject->parameters, "latency", &latency))
latency = GST_SRT_DEFAULT_LATENCY;
if (srt_setsockopt (sock, 0, SRTO_LATENCY, &latency, sizeof (int))) {
g_set_error (error, GST_LIBRARY_ERROR, GST_LIBRARY_ERROR_SETTINGS,
"failed to set latency (reason: %s)", srt_getlasterror_str ());
return FALSE;
}
}
return TRUE;
}