summaryrefslogtreecommitdiff
path: root/sys/shm
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2012-02-08 21:21:47 +0000
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2012-02-09 18:15:09 +0000
commitc83532553663218d7e89590afa574429bc1a3fe3 (patch)
tree0133f409c5405c92036e20314106478f9e759979 /sys/shm
parent0c5037072ad18394188960a6c4d346f22609a864 (diff)
downloadgstreamer-plugins-bad-c83532553663218d7e89590afa574429bc1a3fe3.tar.gz
shmsink: fix indefinite wait after adding a new fd to the poll set
If the second call to _wait blocks, we will not signal the condition variable, so ensure that second call is not blocking. See rationale and information in the linked bug: https://bugzilla.gnome.org/show_bug.cgi?id=669697
Diffstat (limited to 'sys/shm')
-rw-r--r--sys/shm/gstshmsink.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/shm/gstshmsink.c b/sys/shm/gstshmsink.c
index 111fbbf0f..fd7ffb4ed 100644
--- a/sys/shm/gstshmsink.c
+++ b/sys/shm/gstshmsink.c
@@ -512,12 +512,15 @@ pollthread_func (gpointer data)
{
GstShmSink *self = GST_SHM_SINK (data);
GList *item;
+ GstClockTime timeout = GST_CLOCK_TIME_NONE;
while (!self->stop) {
- if (gst_poll_wait (self->poll, GST_CLOCK_TIME_NONE) < 0)
+ if (gst_poll_wait (self->poll, timeout) < 0)
return NULL;
+ timeout = GST_CLOCK_TIME_NONE;
+
if (self->stop)
return NULL;
@@ -561,6 +564,7 @@ pollthread_func (gpointer data)
functions on that new descriptor, so restart the loop, so _wait
will have been called on all elements of self->poll, whether
they have just been added or not. */
+ timeout = 0;
continue;
}