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/7628>
This commit is contained in:
parent
189cbe7fdd
commit
2caa6721f9
1 changed files with 11 additions and 8 deletions
|
@ -1198,19 +1198,22 @@ gst_srt_object_wait_connect (GstSRTObject * srtobject, gpointer sa,
|
|||
}
|
||||
poll_added = TRUE;
|
||||
|
||||
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->sock = sock;
|
||||
|
||||
/* Register the SRT listen callback */
|
||||
if (srt_listen_callback (srtobject->sock,
|
||||
(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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue