mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
srtsink: Register SRT listen callback before binding socket
This change https://github.com/Haivision/srt/pull/2683 forces us to call `srt_listen_callback` before `srt_listen`. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7688>
This commit is contained in:
parent
28c18b5390
commit
718ed88290
1 changed files with 11 additions and 9 deletions
|
@ -1139,20 +1139,22 @@ gst_srt_object_wait_connect (GstSRTObject * srtobject,
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (srtobject->element, "Starting to listen on bind socket");
|
|
||||||
if (srt_listen (sock, 1) == SRT_ERROR) {
|
|
||||||
g_set_error (error, GST_RESOURCE_ERROR,
|
|
||||||
GST_RESOURCE_ERROR_OPEN_READ_WRITE, "Cannot listen on bind socket: %s",
|
|
||||||
srt_getlasterror_str ());
|
|
||||||
|
|
||||||
goto failed;
|
|
||||||
}
|
|
||||||
|
|
||||||
srtobject->listener_sock = sock;
|
srtobject->listener_sock = sock;
|
||||||
|
|
||||||
/* Register the SRT listen callback */
|
/* Register the SRT listen callback */
|
||||||
if (srt_listen_callback (srtobject->listener_sock,
|
if (srt_listen_callback (srtobject->listener_sock,
|
||||||
(srt_listen_callback_fn *) srt_listen_callback_func, srtobject)) {
|
(srt_listen_callback_fn *) srt_listen_callback_func, srtobject)) {
|
||||||
|
g_set_error (error, GST_RESOURCE_ERROR,
|
||||||
|
GST_RESOURCE_ERROR_OPEN_READ_WRITE,
|
||||||
|
"Failed to register SRT listen callback: %s", srt_getlasterror_str ());
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (srtobject->element, "Starting to listen on bind socket");
|
||||||
|
if (srt_listen (sock, 1) == SRT_ERROR) {
|
||||||
|
g_set_error (error, GST_RESOURCE_ERROR,
|
||||||
|
GST_RESOURCE_ERROR_OPEN_READ_WRITE, "Cannot listen on bind socket: %s",
|
||||||
|
srt_getlasterror_str ());
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue