Hi, following appears to me as a bug and might be a subject for solving/discussing. The internal state of the mainloop is wrong, after one do restarts it. Following example illustrates it: // start and stop for the first time pa_threaded_mainloop_start(m); pa_threaded_mainloop_stop(m); // stop causes m->state = STATE_QUIT // start and stop for the second time fails, because of an assertion pa_threaded_mainloop_start(m); this fails, since this assertion assert(m->state == STATE_PASSIVE) : mainloop.c:827 fires. The problem here is that the internal state hasn't been changed back to STATE_PASSIVE, as soon as it was restarted and remains STATE_QUIT, hence assertion fails. A solution might be to change the state accordingly in pa_mainloop_run, i.e.: int pa_mainloop_run(pa_mainloop *m, int *retval) { int r; m->state = STATE_PASSIVE; // ADD THIS HERE while ((r = pa_mainloop_iterate(m, 1, retval)) >= 0); ...
The threaded mainloop is not intended to be started/stopped multiple times. Out of curiosity, though, why would you want to do this?
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.