mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
thread-mq: do final q flush only when we aren't dispatching anyway
This commit is contained in:
parent
0c20e740f6
commit
011add1c83
1 changed files with 5 additions and 3 deletions
|
|
@ -59,7 +59,7 @@ static void asyncmsgq_read_cb(pa_mainloop_api*api, pa_io_event* e, int fd, pa_io
|
|||
pa_memchunk chunk;
|
||||
|
||||
/* Check whether there is a message for us to process */
|
||||
while (pa_asyncmsgq_get(aq, &object, &code, &data, &offset, &chunk, 0) == 0) {
|
||||
while (pa_asyncmsgq_get(aq, &object, &code, &data, &offset, &chunk, 0) >= 0) {
|
||||
int ret;
|
||||
|
||||
ret = pa_asyncmsgq_dispatch(object, code, data, offset, &chunk);
|
||||
|
|
@ -107,9 +107,11 @@ void pa_thread_mq_done(pa_thread_mq *q) {
|
|||
/* Since we are called from main context we can be sure that the
|
||||
* inq is empty. However, the outq might still contain messages
|
||||
* for the main loop, which we need to dispatch (e.g. release
|
||||
* msgs, other stuff). Hence do so. */
|
||||
* msgs, other stuff). Hence do so if we aren't currently
|
||||
* dispatching anyway. */
|
||||
|
||||
pa_asyncmsgq_flush(q->outq, TRUE);
|
||||
if (!pa_asyncmsgq_dispatching(q->outq))
|
||||
pa_asyncmsgq_flush(q->outq, TRUE);
|
||||
|
||||
q->mainloop->io_free(q->read_event);
|
||||
q->mainloop->io_free(q->write_event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue