[FFmpeg-cvslog] oss: warn when non block mode cannot be enabled.

Michael Niedermayer git at videolan.org
Mon Nov 5 00:29:26 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov  4 21:23:13 2012 +0100| [1ba0d9b5d110bc785acbffea54c4e33993d26425] | committer: Michael Niedermayer

oss: warn when non block mode cannot be enabled.

Fixes CID732183
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ba0d9b5d110bc785acbffea54c4e33993d26425
---

 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 5c8b3b9..aa40034 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;
 



More information about the ffmpeg-cvslog mailing list