The do_expected_timeout() function may release the JBUF_LOCK, so we need
to check if nothing wanted the timer thread to exit after this call.
The side effect was that we may endup going back into waiting for a timer
which will cause arbitrary delay on tear down (or deadlock when test
clock is used).
Fixes #653
}
} while ((timer = rtp_timer_queue_pop_until (priv->timers, now)));
- /* execetute the remaining timers */
+ /* execute the remaining timers */
while ((timer = (RtpTimer *) g_queue_pop_head_link (&timers)))
do_timeout (jitterbuffer, timer, now);
+
+ /* do_expected_timeout(), called by do_timeout will drop the
+ * JBUF_LOCK, so we need to check if we are still running */
+ if (!priv->timer_running)
+ goto stopping;
}
timer = rtp_timer_queue_peek_earliest (priv->timers);