From d2202f516ab0b1856efc09bbeddd29ece735b80a Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 28 Feb 2023 18:54:27 -0500 Subject: [PATCH] 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: --- subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c b/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c index d16e2b9166..049812885d 100644 --- a/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c +++ b/subprojects/gst-plugins-bad/ext/srt/gstsrtobject.c @@ -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