Mercurial > libavformat.hg
diff audio.c @ 2767:59fb7b65fcc6 libavformat
Do not use perror() in audio, video, and DV grabbers
author | lucabe |
---|---|
date | Mon, 19 Nov 2007 07:54:04 +0000 |
parents | 2ede5472f331 |
children |
line wrap: on
line diff
--- a/audio.c Mon Nov 19 00:02:58 2007 +0000 +++ b/audio.c Mon Nov 19 07:54:04 2007 +0000 @@ -58,7 +58,7 @@ else audio_fd = open(audio_device, O_RDONLY); if (audio_fd < 0) { - perror(audio_device); + av_log(NULL, AV_LOG_ERROR, "%s: %s\n", audio_device, strerror(errno)); return AVERROR(EIO); } @@ -114,14 +114,14 @@ } err=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &tmp); if (err < 0) { - perror("SNDCTL_DSP_SETFMT"); + av_log(NULL, AV_LOG_ERROR, "SNDCTL_DSP_SETFMT: %s\n", strerror(errno)); goto fail; } tmp = (s->channels == 2); err = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp); if (err < 0) { - perror("SNDCTL_DSP_STEREO"); + av_log(NULL, AV_LOG_ERROR, "SNDCTL_DSP_STEREO: %s\n", strerror(errno)); goto fail; } if (tmp) @@ -130,7 +130,7 @@ tmp = s->sample_rate; err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp); if (err < 0) { - perror("SNDCTL_DSP_SPEED"); + av_log(NULL, AV_LOG_ERROR, "SNDCTL_DSP_SPEED: %s\n", strerror(errno)); goto fail; } s->sample_rate = tmp; /* store real sample rate */