diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-18 23:13:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-18 23:22:33 +0200 |
commit | 837605704dafdfe7df2a87fd3eac2a8458e3329c (patch) | |
tree | ce516cbc78bcf17016dcb6247c93afd23a4294a1 /libavdevice/oss_audio.c | |
parent | 85cf049d5092cbcb8f81defeb8dcdb1f9a21ecf1 (diff) | |
parent | b7c77912b62163b3b46ce93fe42fff3c83604c82 (diff) | |
download | ffmpeg-streaming-837605704dafdfe7df2a87fd3eac2a8458e3329c.zip ffmpeg-streaming-837605704dafdfe7df2a87fd3eac2a8458e3329c.tar.gz |
Merge commit 'b7c77912b62163b3b46ce93fe42fff3c83604c82'
* commit 'b7c77912b62163b3b46ce93fe42fff3c83604c82':
oss_audio: use a macro to simplify ioctl() error checking
Conflicts:
libavdevice/oss_audio.c
See: 69c7aad494683953e833e8622776e3bbcc7921ed
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/oss_audio.c')
-rw-r--r-- | libavdevice/oss_audio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 951acbc..4eb6a50 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -49,6 +49,7 @@ 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); @@ -74,14 +75,15 @@ int ff_oss_audio_open(AVFormatContext *s1, int is_output, #define CHECK_IOCTL_ERROR(event) \ if (err < 0) { \ - av_log(s1, AV_LOG_ERROR, #event ": %s\n", strerror(errno)); \ + av_strerror(AVERROR(errno), errbuff, sizeof(errbuff)); \ + av_log(s1, AV_LOG_ERROR, #event ": %s\n", errbuff); \ goto fail; \ } /* select format : favour native format * We don't CHECK_IOCTL_ERROR here because even if failed OSS still may be * 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 = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp); if (err < 0) { av_log(s1, AV_LOG_WARNING, "SNDCTL_DSP_GETFMTS: %s\n", strerror(errno)); |