Revision 78d9356d audio/ossaudio.c

b/audio/ossaudio.c
38 38
#define AUDIO_CAP "oss"
39 39
#include "audio_int.h"
40 40

  
41
#if defined OSS_GETVERSION && defined SNDCTL_DSP_POLICY
42
#define USE_DSP_POLICY
43
#endif
44

  
41 45
typedef struct OSSVoiceOut {
42 46
    HWVoiceOut hw;
43 47
    void *pcm_buf;
......
240 244
                     struct oss_params *obt, int *pfd)
241 245
{
242 246
    int fd;
243
#ifdef OSS_GETVERSION
247
#ifdef USE_DSP_POLICY
244 248
    int version;
245 249
#endif
246 250
    int oflags = conf.exclusive ? O_EXCL : 0;
......
283 287
        goto err;
284 288
    }
285 289

  
286
#ifdef OSS_GETVERSION
290
#ifdef USE_DSP_POLICY
287 291
    if (ioctl (fd, OSS_GETVERSION, &version)) {
288 292
        oss_logerr2 (errno, typ, "Failed to get OSS version\n");
289 293
        version = 0;
......
292 296
    if (conf.debug) {
293 297
        dolog ("OSS version = %#x\n", version);
294 298
    }
295
#endif
296 299

  
297
#ifdef SNDCTL_DSP_POLICY
298
    if (conf.policy >= 0
299
#ifdef OSS_GETVERSION
300
        && version >= 0x040000
301
#else
302
        0
303
#endif
304
        )
300
    if (conf.policy >= 0 && version >= 0x040000)
305 301
    {
306 302
        int policy = conf.policy;
307 303
        if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) {
......
868 864
        .valp  = &conf.exclusive,
869 865
        .descr = "Open device in exclusive mode (vmix wont work)"
870 866
    },
871
#ifdef SNDCTL_DSP_POLICY
867
#ifdef USE_DSP_POLICY
872 868
    {
873 869
        .name  = "POLICY",
874 870
        .tag   = AUD_OPT_INT,

Also available in: Unified diff