[pulseaudio-discuss] Pulseaudio and Qt4

Lennart Poettering lennart at poettering.net
Tue Sep 25 13:36:13 PDT 2007

On Wed, 19.09.07 23:34, Nicolas Peyron (peyronn at free.fr) wrote:

> Le mercredi 12 septembre 2007, Lennart Poettering a écrit :
> > On Wed, 05.09.07 14:55, Nicolas Peyron (peyronn at free.fr) wrote:
> > > Le mercredi 5 septembre 2007, Nicolas Peyron a écrit :
> > > > Anyways the code is here http://lyio/git/QtPulseAudio/ if you want to
> > > > take a look.
> > >
> > > It's http://lyio.org/git/QtPulseAudio.git/
> >
> > Hmm, is there a gitweb available anywher? I am a lazy bastard ... ;-)
> Here it's https://lyio.org/gitweb/?p=QtPulseAudio.git;a=summary :)

A few comments:

Are you sure you need three seperate "SocketNotifiers" in the IOEvent
class? Can't you OR them together?

On POSIX POLLHUP, POLLERR, POLLNVAL are ignored when you write them to
pollfd->events. They are only valid in ->revents. Thus I wonder about
the validity of the third notifier you are using.

(Hmm, and did I mention that the QT event loop sucks big time? BTW:
couldn't you just be using the glib event loop? I heard that
internally Qt uses the glib mainloop these days anyway?)

The implementation of IOEvent::onException() is not correct, because
the event object might have been destructed from the callback. Hence
the second callback might be called for an event that is no longer valid.

pa_usec_t is unsigned. The comparison < 0 is thus unlikely to
succeed ever in TimeEvent::restart(). Use something like
pa_timeval_cmp(pa_gettimeofday(&now), tv) < 0. Also, passing NULL as
tv is supposed to deactivate the time event. Passing a time that
already passed (including {0, 0}) should cause the event to be
dispatched in the next event loop iteration. (a little bit like the
defer event)

Otherwise this looks pretty good to me. Does the event loop
abstraction work properly?


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the pulseaudio-discuss mailing list