From 39133efc1b991d91683f7cc36d2ef32896556aa1 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 31 Jul 2014 21:01:07 +0200 Subject: [PATCH] avdevice/oss_audio: Check SNDCTL_DSP_GETFMTS failure, print a warning but continue Found-by: CSA and Timothy Gu Signed-off-by: Michael Niedermayer --- libavdevice/oss_audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index d27da85812..951acbcc36 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -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 * fail anyway. `err =` kept to eliminate compiler warning. */ 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 (tmp & AFMT_S16_BE) {