[pulseaudio-tickets] [Bug 40698] New: cannot restart mainloop if this was stopped before

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Sep 7 14:29:00 PDT 2011


https://bugs.freedesktop.org/show_bug.cgi?id=40698

           Summary: cannot restart mainloop if this was stopped before
           Product: PulseAudio
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: core
        AssignedTo: pulseaudio-bugs at lists.freedesktop.org
        ReportedBy: tevs at mpi-inf.mpg.de
         QAContact: pulseaudio-bugs at lists.freedesktop.org
                CC: lennart at poettering.net


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);
...

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the pulseaudio-bugs mailing list