From 1ba0d9b5d110bc785acbffea54c4e33993d26425 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 4 Nov 2012 21:23:13 +0100 Subject: [PATCH] oss: warn when non block mode cannot be enabled. Fixes CID732183 Signed-off-by: Michael Niedermayer --- libavdevice/oss_audio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 5c8b3b9727..aa40034ea9 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -76,8 +76,11 @@ static int audio_open(AVFormatContext *s1, int is_output, const char *audio_devi } /* non blocking mode */ - if (!is_output) - fcntl(audio_fd, F_SETFL, O_NONBLOCK); + if (!is_output) { + if (fcntl(audio_fd, F_SETFL, O_NONBLOCK) < 0) { + av_log(s1, AV_LOG_WARNING, "%s: Could not enable non block mode (%s)\n", audio_device, strerror(errno)); + } + } s->frame_size = AUDIO_BLOCK_SIZE;