OSS sound

Rob Crittenden <[email protected]>
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <[email protected]>
I started poking around winealsa to see if I could contribute anything.
Since the OSS section is much better tested I thought I'd do a comparison
to see if there was anything quick that could be ported over. During this
review I found a discrepency.

Now #ifdef USE_PIPE_SYNC is always used in OSS but if one really wants to
use Windows events instead the code is there. This is where the discrepency
is.

In #ifdef USE_PIPE_SYNC you have:

#define CLEAR_OMR(omr) do { int x = 0; read((omr)->msg_pipe[0], &x, sizeof(x)); } while (0)
#define RESET_OMR(omr) do { } while (0)

and in the #else you have:

#define CLEAR_OMR(omr) do { } while (0)
#define RESET_OMR(omr) do { ResetEvent((omr)->msg_event); } while (0)

So basically clear and reset are reversed depending on whether one is using
pipes or events. 

If the unix pipes are clearly faster it would seem a good optimization to
port this code over to the Alsa driver (which still uses events) but I
wonder which behavior is correct. This looks like real low-hanging fruit.

It also seems strange to go thru the trouble of a while loop that will always
be false...

rob



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.