Commit 9ba6133b authored by stefano's avatar stefano

Replace all the occurrences of AVERROR_EIO with AVERROR(EIO), and mark

AVERROR_EIO for deletion at the next major bump.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22513 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent c17e8f68
...@@ -74,7 +74,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, ...@@ -74,7 +74,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
if (res < 0) { if (res < 0) {
av_log(ctx, AV_LOG_ERROR, "cannot open audio device %s (%s)\n", av_log(ctx, AV_LOG_ERROR, "cannot open audio device %s (%s)\n",
audio_device, snd_strerror(res)); audio_device, snd_strerror(res));
return AVERROR_IO; return AVERROR(EIO);
} }
res = snd_pcm_hw_params_malloc(&hw_params); res = snd_pcm_hw_params_malloc(&hw_params);
...@@ -153,7 +153,7 @@ fail: ...@@ -153,7 +153,7 @@ fail:
snd_pcm_hw_params_free(hw_params); snd_pcm_hw_params_free(hw_params);
fail1: fail1:
snd_pcm_close(h); snd_pcm_close(h);
return AVERROR_IO; return AVERROR(EIO);
} }
av_cold int ff_alsa_close(AVFormatContext *s1) av_cold int ff_alsa_close(AVFormatContext *s1)
...@@ -175,7 +175,7 @@ int ff_alsa_xrun_recover(AVFormatContext *s1, int err) ...@@ -175,7 +175,7 @@ int ff_alsa_xrun_recover(AVFormatContext *s1, int err)
if (err < 0) { if (err < 0) {
av_log(s1, AV_LOG_ERROR, "cannot recover from underrun (snd_pcm_prepare failed: %s)\n", snd_strerror(err)); av_log(s1, AV_LOG_ERROR, "cannot recover from underrun (snd_pcm_prepare failed: %s)\n", snd_strerror(err));
return AVERROR_IO; return AVERROR(EIO);
} }
} else if (err == -ESTRPIPE) { } else if (err == -ESTRPIPE) {
av_log(s1, AV_LOG_ERROR, "-ESTRPIPE... Unsupported!\n"); av_log(s1, AV_LOG_ERROR, "-ESTRPIPE... Unsupported!\n");
......
...@@ -240,7 +240,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -240,7 +240,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
if(!ap->time_base.den) { if(!ap->time_base.den) {
av_log(s, AV_LOG_ERROR, "A time base must be specified.\n"); av_log(s, AV_LOG_ERROR, "A time base must be specified.\n");
return AVERROR_IO; return AVERROR(EIO);
} }
ctx->s = s; ctx->s = s;
...@@ -248,7 +248,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -248,7 +248,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0); ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0);
if(!ctx->hwnd) { if(!ctx->hwnd) {
av_log(s, AV_LOG_ERROR, "Could not create capture window.\n"); av_log(s, AV_LOG_ERROR, "Could not create capture window.\n");
return AVERROR_IO; return AVERROR(EIO);
} }
/* If atoi fails, devnum==0 and the default device is used */ /* If atoi fails, devnum==0 and the default device is used */
...@@ -390,7 +390,7 @@ fail_bi: ...@@ -390,7 +390,7 @@ fail_bi:
fail_io: fail_io:
vfw_read_close(s); vfw_read_close(s);
return AVERROR_IO; return AVERROR(EIO);
} }
static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt) static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
......
...@@ -338,9 +338,9 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt) ...@@ -338,9 +338,9 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
uint32_t extra_size = 8; uint32_t extra_size = 8;
if (url_feof(s->pb)) if (url_feof(s->pb))
return AVERROR_IO; return AVERROR(EIO);
if (ape->currentframe > ape->totalframes) if (ape->currentframe > ape->totalframes)
return AVERROR_IO; return AVERROR(EIO);
url_fseek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET); url_fseek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET);
......
...@@ -293,13 +293,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -293,13 +293,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t left = CAF_MAX_PKT_SIZE; int64_t left = CAF_MAX_PKT_SIZE;
if (url_feof(pb)) if (url_feof(pb))
return AVERROR_IO; return AVERROR(EIO);
/* don't read past end of data chunk */ /* don't read past end of data chunk */
if (caf->data_size > 0) { if (caf->data_size > 0) {
left = (caf->data_start + caf->data_size) - url_ftell(pb); left = (caf->data_start + caf->data_size) - url_ftell(pb);
if (left <= 0) if (left <= 0)
return AVERROR_IO; return AVERROR(EIO);
} }
pkt_frames = caf->frames_per_packet; pkt_frames = caf->frames_per_packet;
...@@ -317,12 +317,12 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -317,12 +317,12 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
pkt_size = caf->num_bytes - st->index_entries[caf->packet_cnt].pos; pkt_size = caf->num_bytes - st->index_entries[caf->packet_cnt].pos;
pkt_frames = st->duration - st->index_entries[caf->packet_cnt].timestamp; pkt_frames = st->duration - st->index_entries[caf->packet_cnt].timestamp;
} else { } else {
return AVERROR_IO; return AVERROR(EIO);
} }
} }
if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left) if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left)
return AVERROR_IO; return AVERROR(EIO);
res = av_get_packet(pb, pkt, pkt_size); res = av_get_packet(pb, pkt, pkt_size);
if (res < 0) if (res < 0)
......
...@@ -70,7 +70,7 @@ static int flac_read_header(AVFormatContext *s, ...@@ -70,7 +70,7 @@ static int flac_read_header(AVFormatContext *s,
} }
if (get_buffer(s->pb, buffer, metadata_size) != metadata_size) { if (get_buffer(s->pb, buffer, metadata_size) != metadata_size) {
av_freep(&buffer); av_freep(&buffer);
return AVERROR_IO; return AVERROR(EIO);
} }
break; break;
/* skip metadata block for unsupported types */ /* skip metadata block for unsupported types */
......
...@@ -97,7 +97,7 @@ static int sox_read_header(AVFormatContext *s, ...@@ -97,7 +97,7 @@ static int sox_read_header(AVFormatContext *s,
char *comment = av_malloc(comment_size+1); char *comment = av_malloc(comment_size+1);
if (get_buffer(pb, comment, comment_size) != comment_size) { if (get_buffer(pb, comment, comment_size) != comment_size) {
av_freep(&comment); av_freep(&comment);
return AVERROR_IO; return AVERROR(EIO);
} }
comment[comment_size] = 0; comment[comment_size] = 0;
......
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
#if LIBAVUTIL_VERSION_MAJOR < 51 #if LIBAVUTIL_VERSION_MAJOR < 51
#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */ #define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
#define AVERROR_IO AVERROR(EIO) /**< I/O error */
#endif #endif
#define AVERROR_IO AVERROR(EIO) /**< I/O error */
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */ #define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */
#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */ #define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */
#define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */ #define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment