diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-18 23:24:23 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-17 23:46:56 +0100 |
commit | afbaa9a737b3546c12fdf328016cc1e587d65dc9 (patch) | |
tree | 75b10167134d095bdc02f61158097515cce74057 /libavdevice/oss_audio.c | |
parent | e60c025e7357fe45efc73c85310626a9e329d0d5 (diff) | |
download | ffmpeg-streaming-afbaa9a737b3546c12fdf328016cc1e587d65dc9.zip ffmpeg-streaming-afbaa9a737b3546c12fdf328016cc1e587d65dc9.tar.gz |
avdevice/oss_audio: avoid strerror() and errbuf
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/oss_audio.c')
-rw-r--r-- | libavdevice/oss_audio.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 4eb6a50..1f8b5e7 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -49,14 +49,13 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output, int audio_fd; int tmp, err; char *flip = getenv("AUDIO_FLIP_LEFT"); - char errbuff[128]; if (is_output) audio_fd = avpriv_open(audio_device, O_WRONLY); else audio_fd = avpriv_open(audio_device, O_RDONLY); if (audio_fd < 0) { - av_log(s1, AV_LOG_ERROR, "%s: %s\n", audio_device, strerror(errno)); + av_log(s1, AV_LOG_ERROR, "%s: %s\n", audio_device, av_err2str(AVERROR(errno))); return AVERROR(EIO); } @@ -67,7 +66,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output, /* non blocking mode */ 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)); + av_log(s1, AV_LOG_WARNING, "%s: Could not enable non block mode (%s)\n", audio_device, av_err2str(AVERROR(errno))); } } @@ -75,8 +74,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output, #define CHECK_IOCTL_ERROR(event) \ if (err < 0) { \ - av_strerror(AVERROR(errno), errbuff, sizeof(errbuff)); \ - av_log(s1, AV_LOG_ERROR, #event ": %s\n", errbuff); \ + av_log(s1, AV_LOG_ERROR, #event ": %s\n", av_err2str(AVERROR(errno)));\ goto fail; \ } @@ -86,7 +84,7 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output, * fail anyway. */ err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp); if (err < 0) { - av_log(s1, AV_LOG_WARNING, "SNDCTL_DSP_GETFMTS: %s\n", strerror(errno)); + av_log(s1, AV_LOG_WARNING, "SNDCTL_DSP_GETFMTS: %s\n", av_err2str(AVERROR(errno))); } #if HAVE_BIGENDIAN |