#include <stdlib.h>
#include <math.h>
+#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/ioctl.h>
int fd = vlc_open (device, O_WRONLY);
if (fd == -1)
{
- msg_Err (aout, "cannot open OSS device %s: %m", device);
+ msg_Err (aout, "cannot open OSS device %s: %s", device,
+ vlc_strerror_c(errno));
return VLC_EGENERIC;
}
sys->fd = fd;
if (ioctl (fd, SNDCTL_DSP_SETFMT, &format) < 0)
{
- msg_Err (aout, "cannot set audio format 0x%X: %m", format);
+ msg_Err (aout, "cannot set audio format 0x%X: %s", format,
+ vlc_strerror_c(errno));
goto error;
}
int channels = spdif ? 2 : aout_FormatNbChannels (fmt);
if (ioctl (fd, SNDCTL_DSP_CHANNELS, &channels) < 0)
{
- msg_Err (aout, "cannot set %d channels: %m", channels);
+ msg_Err (aout, "cannot set %d channels: %s", channels,
+ vlc_strerror_c(errno));
goto error;
}
int rate = spdif ? 48000 : fmt->i_rate;
if (ioctl (fd, SNDCTL_DSP_SPEED, &rate) < 0)
{
- msg_Err (aout, "cannot set %d Hz sample rate: %m", rate);
+ msg_Err (aout, "cannot set %d Hz sample rate: %s", rate,
+ vlc_strerror_c(errno));
goto error;
}
if (ioctl (sys->fd, SNDCTL_DSP_GETODELAY, &delay) < 0)
{
- msg_Warn (aout, "cannot get delay: %m");
+ msg_Warn (aout, "cannot get delay: %s", vlc_strerror_c(errno));
return -1;
}
block->i_buffer -= bytes;
}
else
- msg_Err (aout, "cannot write samples: %m");
+ msg_Err (aout, "cannot write samples: %s", vlc_strerror_c(errno));
}
block_Release (block);
level |= level << 8;
if (!sys->mute && ioctl (fd, SNDCTL_DSP_SETPLAYVOL, &level) < 0)
{
- msg_Err (aout, "cannot set volume: %m");
+ msg_Err (aout, "cannot set volume: %s", vlc_strerror_c(errno));
return -1;
}
int level = mute ? 0 : (sys->level | (sys->level << 8));
if (ioctl (fd, SNDCTL_DSP_SETPLAYVOL, &level) < 0)
{
- msg_Err (aout, "cannot mute: %m");
+ msg_Err (aout, "cannot mute: %s", vlc_strerror_c(errno));
return -1;
}
if (ioctl (fd, SNDCTL_SYSINFO, &si) < 0)
{
- msg_Err (aout, "cannot get system infos: %m");
+ msg_Err (aout, "cannot get system infos: %s", vlc_strerror(errno));
goto out;
}
if (ioctl (fd, SNDCTL_AUDIOINFO, &ai) < 0)
{
- msg_Warn (aout, "cannot get device %d infos: %m", i);
+ msg_Warn (aout, "cannot get device %d infos: %s", i,
+ vlc_strerror_c(errno));
continue;
}
if (ai.caps & (PCM_CAP_HIDDEN|PCM_CAP_MODEM))