summaryrefslogtreecommitdiff
path: root/libavformat/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/audio.c')
-rw-r--r--libavformat/audio.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/audio.c b/libavformat/audio.c
index b17dcea8e7..ce209d1a9f 100644
--- a/libavformat/audio.c
+++ b/libavformat/audio.c
@@ -59,7 +59,7 @@ static int audio_open(AudioData *s, int is_output, const char *audio_device)
audio_fd = open(audio_device, O_RDONLY);
if (audio_fd < 0) {
perror(audio_device);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
if (flip && *flip == '1') {
@@ -110,7 +110,7 @@ static int audio_open(AudioData *s, int is_output, const char *audio_device)
default:
av_log(NULL, AV_LOG_ERROR, "Soundcard does not support 16 bit sample format\n");
close(audio_fd);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
err=ioctl(audio_fd, SNDCTL_DSP_SETFMT, &tmp);
if (err < 0) {
@@ -139,7 +139,7 @@ static int audio_open(AudioData *s, int is_output, const char *audio_device)
return 0;
fail:
close(audio_fd);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
static int audio_close(AudioData *s)
@@ -160,7 +160,7 @@ static int audio_write_header(AVFormatContext *s1)
s->channels = st->codec->channels;
ret = audio_open(s, 1, s1->filename);
if (ret < 0) {
- return AVERROR_IO;
+ return AVERROR(EIO);
} else {
return 0;
}
@@ -185,7 +185,7 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
if (ret > 0)
break;
if (ret < 0 && (errno != EAGAIN && errno != EINTR))
- return AVERROR_IO;
+ return AVERROR(EIO);
}
s->buffer_ptr = 0;
}
@@ -224,7 +224,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap)
ret = audio_open(s, 0, s1->filename);
if (ret < 0) {
av_free(st);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
/* take real parameters */
@@ -245,7 +245,7 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
struct audio_buf_info abufi;
if (av_new_packet(pkt, s->frame_size) < 0)
- return AVERROR_IO;
+ return AVERROR(EIO);
for(;;) {
struct timeval tv;
fd_set fds;
@@ -270,7 +270,7 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
}
if (!(ret == 0 || (ret == -1 && (errno == EAGAIN || errno == EINTR)))) {
av_free_packet(pkt);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
}
pkt->size = ret;