if set->control_pending is set to 0 but we didn't not succed reading
the control socket, future calls to gst_poll_wait() will be awaiken
by the control socket which will not be released properly because
set->control_pending is already 0, causing an infinite loop.
/* try to remove all pending control messages */
if (g_atomic_int_compare_and_exchange (&set->control_pending, old, 0)) {
/* we managed to remove all messages, read the control socket */
- (void) RELEASE_EVENT (set);
- break;
+ if (RELEASE_EVENT (set))
+ break;
+ else
+ /* retry again until we read it successfully */
+ g_atomic_int_exchange_and_add (&set->control_pending, 1);
}
}
return old;