mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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
This commit is contained in:
parent
0c5037072a
commit
c835325536
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue