case SF_S16_BE: return AFMT_S16_BE;
case SF_U16_LE: return AFMT_U16_LE;
case SF_U16_BE: return AFMT_U16_BE;
- default: return AFMT_S16_LE;
+ default: return -E_BAD_SAMPLE_FORMAT;
}
}
if (ret < 0)
goto err;
/* set PCM format */
- sample_format = format = get_oss_format(sample_format);
+ ret = get_oss_format(sample_format);
+ if (ret < 0)
+ return ret;
+ sample_format = format = ret;
ret = ioctl(powd->fd, SNDCTL_DSP_SETFMT, &format);
if (ret < 0) {
ret = -ERRNO_TO_PARA_ERROR(errno);
+ PARA_ERROR_LOG("could not set sample format\n");
goto err;
}
ret = -E_BAD_SAMPLE_FORMAT;