Revision 6d246526

b/audio/ossaudio.c
244 244
                     struct oss_params *obt, int *pfd)
245 245
{
246 246
    int fd;
247
#ifdef USE_DSP_POLICY
248
    int version;
249
#endif
250 247
    int oflags = conf.exclusive ? O_EXCL : 0;
251 248
    audio_buf_info abinfo;
252 249
    int fmt, freq, nchannels;
......
288 285
    }
289 286

  
290 287
#ifdef USE_DSP_POLICY
291
    if (ioctl (fd, OSS_GETVERSION, &version)) {
292
        oss_logerr2 (errno, typ, "Failed to get OSS version\n");
293
        version = 0;
294
    }
288
    if (conf.policy >= 0) {
289
        int version;
295 290

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

  
300
    if (conf.policy >= 0 && version >= 0x040000)
301
    {
302
        int policy = conf.policy;
303
        if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) {
304
            oss_logerr2 (errno, typ, "Failed to set timing policy to %d\n",
305
                         conf.policy);
306
            goto err;
296
        if (conf.debug) {
297
            dolog ("OSS version = %#x\n", version);
298
        }
299

  
300
        if (version >= 0x040000) {
301
            int policy = conf.policy;
302
            if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) {
303
                oss_logerr2 (errno, typ, "Failed to set timing policy to %d\n",
304
                             conf.policy);
305
                goto err;
306
            }
307 307
        }
308 308
    }
309 309
    else

Also available in: Unified diff