[vorbis-dev] optimization to libao audio output autodetection code

David Walser luigiwalser at yahoo.com
Thu Jul 10 19:27:56 PDT 2003


Ok, this patch replaces the old patch I sent, and it
does a bit more.

For one, it sorts the linked list of drivers based on
the priority values, highest valued ones coming first.
 That allows the _find_default_driver_id code to stop
looping (break) immediately when it finds a driver
that works, because it already knows it's the working
driver with the highest priority (what it normally
returns anyway).

The advantage to sorting based on priority, is it
gives us some control over what order the drivers are
tested in, because currently the order comes from the
dirent (directory entry), which we AFAIK have no
control over.

So that's an optimization, the other one is what I was
trying before with arts, have it only pass the test()
if arts has the DSP open and give it a higher
priority, so if that all is true, we can select arts
immediately instead of wasting time testing the others
which aren't going to work.  This new patch also does
the same for esd.

All in all, this patch gives us better control over
what drivers have to get tested, and the order they're
tested in, and makes the autodetection a bit faster.

Patch libao-0.8.3-autodetection.patch attached.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libao-0.8.3-autodetection.patch
Type: text/x-diff
Size: 5495 bytes
Desc: libao-0.8.3-autodetection.patch
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20030710/1bbb2a33/libao-0.8.3-autodetection.bin


More information about the Vorbis-dev mailing list