[PD-dev] bitwise magic in OSS-backend

Miller Puckette msp at ucsd.edu
Sun Mar 20 01:57:03 CET 2016


Certainly not correct - I'll fix it.  I believe "oss" is still the preferred
API on BSD OSes - so still relevant.

cheers
Miller

On Wed, Mar 16, 2016 at 11:06:47AM +0100, IOhannes m zmölnig wrote:
> while running Pd through some static code analysis, i stumbled upon the
> following in s_audio_oss.c:322-325
> 
> ~~~
> if ((flags = fcntl(fd, F_GETFL)) < 0)
>    post("couldn't get audio device flags");
> else if (fcntl(fd, F_SETFL, flags & (!O_NDELAY)) < 0)
>    post("couldn't set audio device flags");
> ~~~
> 
> i guess this is meant to put the device into blocking-mode (without
> changing other device settings), so Pd could use it as a time-source,
> but shouldn't it then read :
>     flags & (~O_NDELAY)
> 
> 
> i guess the OSS code has not been used for a while, and probably the
> 'flags' only ever contained the O_NDELAY bit (if any), so it haven't
> made much of a difference...
> 
> fmads
> IOhannes
> 




> _______________________________________________
> Pd-dev mailing list
> Pd-dev at lists.iem.at
> http://lists.puredata.info/listinfo/pd-dev




More information about the Pd-dev mailing list