examples: also handle SDL events in main-thread

This commit is contained in:
Wim Taymans 2018-01-18 15:49:42 +01:00
parent 0b523e4334
commit 47dd97049c
2 changed files with 4 additions and 4 deletions

View file

@ -452,6 +452,8 @@ static int do_render(struct spa_loop *loop, bool async, uint32_t seq,
int i;
uint8_t *src, *dst;
handle_events(d);
if (d->io->status != SPA_STATUS_HAVE_BUFFER)
return 0;
@ -506,8 +508,6 @@ static int impl_node_process_input(struct spa_node *node)
SPA_ID_INVALID, NULL, 0, true, d)) < 0)
return res;
handle_events(d);
return d->io->status = SPA_STATUS_NEED_BUFFER;
}

View file

@ -108,6 +108,8 @@ do_render(struct spa_loop *loop, bool async, uint32_t seq,
int i;
uint8_t *src, *dst;
handle_events(data);
if (buf->datas[0].type == data->type.data.MemFd ||
buf->datas[0].type == data->type.data.DmaBuf) {
map = mmap(NULL, buf->datas[0].maxsize + buf->datas[0].mapoffset, PROT_READ,
@ -159,8 +161,6 @@ on_stream_new_buffer(void *_data, uint32_t id)
true, data);
pw_stream_recycle_buffer(stream, id);
handle_events(data);
}
static void on_stream_state_changed(void *_data, enum pw_stream_state old,