aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio/out/ao_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_oss.c')
-rw-r--r--audio/out/ao_oss.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c
index 5dc1ea9830..826bb1cf2f 100644
--- a/audio/out/ao_oss.c
+++ b/audio/out/ao_oss.c
@@ -322,7 +322,8 @@ static int reopen_device(struct ao *ao, bool allow_format_changes)
#endif
if (AF_FORMAT_IS_IEC61937(format)) {
- ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &samplerate);
+ if (ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &samplerate) == -1)
+ goto fail;
// Probably could be fixed by setting number of channels; needs testing.
if (channels.num != 2) {
MP_ERR(ao, "Format %s not implemented.\n", af_fmt_to_str(format));
@@ -374,7 +375,8 @@ static int reopen_device(struct ao *ao, bool allow_format_changes)
MP_VERBOSE(ao, "using %d channels (requested: %d)\n",
channels.num, reqchannels);
// set rate
- ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &samplerate);
+ if (ioctl(p->audio_fd, SNDCTL_DSP_SPEED, &samplerate) == -1)
+ goto fail;
MP_VERBOSE(ao, "using %d Hz samplerate\n", samplerate);
}