Commit 39133efc authored by Michael Niedermayer's avatar Michael Niedermayer

avdevice/oss_audio: Check SNDCTL_DSP_GETFMTS failure, print a warning but continue

Found-by: 's avatarCSA and Timothy Gu <timothygu99@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fc19edd8
...@@ -83,6 +83,9 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output, ...@@ -83,6 +83,9 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output,
* usable. If OSS is not usable the SNDCTL_DSP_SETFMTS later is going to * usable. If OSS is not usable the SNDCTL_DSP_SETFMTS later is going to
* fail anyway. `err =` kept to eliminate compiler warning. */ * fail anyway. `err =` kept to eliminate compiler warning. */
err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp); err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
if (err < 0) {
av_log(s1, AV_LOG_WARNING, "SNDCTL_DSP_GETFMTS: %s\n", strerror(errno));
}
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
if (tmp & AFMT_S16_BE) { if (tmp & AFMT_S16_BE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment