srt: Consider EPOLLEMPTY an error when not unlocking

Seems that SRT can remove the socket from the poll by itself when the
connection gets closed. Consider this an error condition and ensure we
only "abort successfully" when we're actually trying to unlock.

Needs more investigation but this is enough to prevent the element from
getting stuck not reporting an error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4087>
This commit is contained in:
Jan Alexander Steffens (heftig) 2023-02-28 18:54:27 -05:00 committed by GStreamer Marge Bot
parent cf5b659bc6
commit d2202f516a

View file

@ -1526,7 +1526,7 @@ gst_srt_object_read (GstSRTObject * srtobject,
gint srt_errno = srt_getlasterror (NULL);
#if SRT_VERSION_VALUE >= 0x010402
if (srt_errno == SRT_EPOLLEMPTY)
if (srt_errno == SRT_EPOLLEMPTY && g_cancellable_is_cancelled (cancellable))
return 0;
#endif
@ -1659,7 +1659,7 @@ gst_srt_object_send_headers (GstSRTObject * srtobject, SRTSOCKET sock,
gint srt_errno = srt_getlasterror (NULL);
#if SRT_VERSION_VALUE >= 0x010402
if (srt_errno == SRT_EPOLLEMPTY)
if (srt_errno == SRT_EPOLLEMPTY && g_cancellable_is_cancelled (cancellable))
return TRUE;
#endif
@ -1821,7 +1821,7 @@ gst_srt_object_write_one (GstSRTObject * srtobject,
gint srt_errno = srt_getlasterror (NULL);
#if SRT_VERSION_VALUE >= 0x010402
if (srt_errno == SRT_EPOLLEMPTY)
if (srt_errno == SRT_EPOLLEMPTY && g_cancellable_is_cancelled (cancellable))
return 0;
#endif