From 1e77971dff3089a17ad425703a7df8e6ea321924 Mon Sep 17 00:00:00 2001 From: Samuel Maroy Date: Wed, 23 Sep 2015 17:12:34 +0200 Subject: [PATCH] shmsink: continue polling after EINTR https://bugzilla.gnome.org/show_bug.cgi?id=779856 --- sys/shm/gstshmsink.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/shm/gstshmsink.c b/sys/shm/gstshmsink.c index c3514c7829..8fcb9596a1 100644 --- a/sys/shm/gstshmsink.c +++ b/sys/shm/gstshmsink.c @@ -779,11 +779,19 @@ pollthread_func (gpointer data) GstShmSink *self = GST_SHM_SINK (data); GList *item; GstClockTime timeout = GST_CLOCK_TIME_NONE; + int rv = 0; while (!self->stop) { - if (gst_poll_wait (self->poll, timeout) < 0) + do { + rv = gst_poll_wait (self->poll, timeout); + } while (rv < 0 && errno == EINTR); + + if (rv < 0) { + GST_ELEMENT_ERROR (self, RESOURCE, READ, ("Failed waiting on fd activity"), + ("gst_poll_wait returned %d, errno: %d", rv, errno)); return NULL; + } timeout = GST_CLOCK_TIME_NONE;