Am 23.11.2012 18:45, schrieb Dimitar Zhekov:
For POLLIN it's the same as mine. Great minds think alike. :)
For POLLOUT, your version is better, except than any fd for which PeekNamedPipe() returns an error different than ERROR_BROKEN_PIPE is automatically considered OUT. The problem would be how to integrate pa_poll() with glib main loop - g_source_add_poll() is not a regular source, it's supported internally by the context and accesses it's internal poll fields. Pulse has it's own glib-mainloop, but that's a bit on the heavy side... For OUT, I simply call write() at 50ms (configurable), and since Geany on win~1 randomly switches from using 0% CPU time to 6-7%, especially if FF/TB is running, calling write() 20 times per second makes no difference.
Would trying to get that poll into glib be worthwhile?
Best regards