Originally committed as revision 22513 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -74,7 +74,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, |
| 74 | 74 |
if (res < 0) {
|
| 75 | 75 |
av_log(ctx, AV_LOG_ERROR, "cannot open audio device %s (%s)\n", |
| 76 | 76 |
audio_device, snd_strerror(res)); |
| 77 |
- return AVERROR_IO; |
|
| 77 |
+ return AVERROR(EIO); |
|
| 78 | 78 |
} |
| 79 | 79 |
|
| 80 | 80 |
res = snd_pcm_hw_params_malloc(&hw_params); |
| ... | ... |
@@ -153,7 +153,7 @@ fail: |
| 153 | 153 |
snd_pcm_hw_params_free(hw_params); |
| 154 | 154 |
fail1: |
| 155 | 155 |
snd_pcm_close(h); |
| 156 |
- return AVERROR_IO; |
|
| 156 |
+ return AVERROR(EIO); |
|
| 157 | 157 |
} |
| 158 | 158 |
|
| 159 | 159 |
av_cold int ff_alsa_close(AVFormatContext *s1) |
| ... | ... |
@@ -175,7 +175,7 @@ int ff_alsa_xrun_recover(AVFormatContext *s1, int err) |
| 175 | 175 |
if (err < 0) {
|
| 176 | 176 |
av_log(s1, AV_LOG_ERROR, "cannot recover from underrun (snd_pcm_prepare failed: %s)\n", snd_strerror(err)); |
| 177 | 177 |
|
| 178 |
- return AVERROR_IO; |
|
| 178 |
+ return AVERROR(EIO); |
|
| 179 | 179 |
} |
| 180 | 180 |
} else if (err == -ESTRPIPE) {
|
| 181 | 181 |
av_log(s1, AV_LOG_ERROR, "-ESTRPIPE... Unsupported!\n"); |
| ... | ... |
@@ -240,7 +240,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 240 | 240 |
|
| 241 | 241 |
if(!ap->time_base.den) {
|
| 242 | 242 |
av_log(s, AV_LOG_ERROR, "A time base must be specified.\n"); |
| 243 |
- return AVERROR_IO; |
|
| 243 |
+ return AVERROR(EIO); |
|
| 244 | 244 |
} |
| 245 | 245 |
|
| 246 | 246 |
ctx->s = s; |
| ... | ... |
@@ -248,7 +248,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 248 | 248 |
ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0); |
| 249 | 249 |
if(!ctx->hwnd) {
|
| 250 | 250 |
av_log(s, AV_LOG_ERROR, "Could not create capture window.\n"); |
| 251 |
- return AVERROR_IO; |
|
| 251 |
+ return AVERROR(EIO); |
|
| 252 | 252 |
} |
| 253 | 253 |
|
| 254 | 254 |
/* If atoi fails, devnum==0 and the default device is used */ |
| ... | ... |
@@ -390,7 +390,7 @@ fail_bi: |
| 390 | 390 |
|
| 391 | 391 |
fail_io: |
| 392 | 392 |
vfw_read_close(s); |
| 393 |
- return AVERROR_IO; |
|
| 393 |
+ return AVERROR(EIO); |
|
| 394 | 394 |
} |
| 395 | 395 |
|
| 396 | 396 |
static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt) |
| ... | ... |
@@ -338,9 +338,9 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt) |
| 338 | 338 |
uint32_t extra_size = 8; |
| 339 | 339 |
|
| 340 | 340 |
if (url_feof(s->pb)) |
| 341 |
- return AVERROR_IO; |
|
| 341 |
+ return AVERROR(EIO); |
|
| 342 | 342 |
if (ape->currentframe > ape->totalframes) |
| 343 |
- return AVERROR_IO; |
|
| 343 |
+ return AVERROR(EIO); |
|
| 344 | 344 |
|
| 345 | 345 |
url_fseek (s->pb, ape->frames[ape->currentframe].pos, SEEK_SET); |
| 346 | 346 |
|
| ... | ... |
@@ -293,13 +293,13 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 293 | 293 |
int64_t left = CAF_MAX_PKT_SIZE; |
| 294 | 294 |
|
| 295 | 295 |
if (url_feof(pb)) |
| 296 |
- return AVERROR_IO; |
|
| 296 |
+ return AVERROR(EIO); |
|
| 297 | 297 |
|
| 298 | 298 |
/* don't read past end of data chunk */ |
| 299 | 299 |
if (caf->data_size > 0) {
|
| 300 | 300 |
left = (caf->data_start + caf->data_size) - url_ftell(pb); |
| 301 | 301 |
if (left <= 0) |
| 302 |
- return AVERROR_IO; |
|
| 302 |
+ return AVERROR(EIO); |
|
| 303 | 303 |
} |
| 304 | 304 |
|
| 305 | 305 |
pkt_frames = caf->frames_per_packet; |
| ... | ... |
@@ -317,12 +317,12 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 317 | 317 |
pkt_size = caf->num_bytes - st->index_entries[caf->packet_cnt].pos; |
| 318 | 318 |
pkt_frames = st->duration - st->index_entries[caf->packet_cnt].timestamp; |
| 319 | 319 |
} else {
|
| 320 |
- return AVERROR_IO; |
|
| 320 |
+ return AVERROR(EIO); |
|
| 321 | 321 |
} |
| 322 | 322 |
} |
| 323 | 323 |
|
| 324 | 324 |
if (pkt_size == 0 || pkt_frames == 0 || pkt_size > left) |
| 325 |
- return AVERROR_IO; |
|
| 325 |
+ return AVERROR(EIO); |
|
| 326 | 326 |
|
| 327 | 327 |
res = av_get_packet(pb, pkt, pkt_size); |
| 328 | 328 |
if (res < 0) |
| ... | ... |
@@ -70,7 +70,7 @@ static int flac_read_header(AVFormatContext *s, |
| 70 | 70 |
} |
| 71 | 71 |
if (get_buffer(s->pb, buffer, metadata_size) != metadata_size) {
|
| 72 | 72 |
av_freep(&buffer); |
| 73 |
- return AVERROR_IO; |
|
| 73 |
+ return AVERROR(EIO); |
|
| 74 | 74 |
} |
| 75 | 75 |
break; |
| 76 | 76 |
/* skip metadata block for unsupported types */ |
| ... | ... |
@@ -97,7 +97,7 @@ static int sox_read_header(AVFormatContext *s, |
| 97 | 97 |
char *comment = av_malloc(comment_size+1); |
| 98 | 98 |
if (get_buffer(pb, comment, comment_size) != comment_size) {
|
| 99 | 99 |
av_freep(&comment); |
| 100 |
- return AVERROR_IO; |
|
| 100 |
+ return AVERROR(EIO); |
|
| 101 | 101 |
} |
| 102 | 102 |
comment[comment_size] = 0; |
| 103 | 103 |
|
| ... | ... |
@@ -36,9 +36,9 @@ |
| 36 | 36 |
|
| 37 | 37 |
#if LIBAVUTIL_VERSION_MAJOR < 51 |
| 38 | 38 |
#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */ |
| 39 |
+#define AVERROR_IO AVERROR(EIO) /**< I/O error */ |
|
| 39 | 40 |
#endif |
| 40 | 41 |
|
| 41 |
-#define AVERROR_IO AVERROR(EIO) /**< I/O error */ |
|
| 42 | 42 |
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */ |
| 43 | 43 |
#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */ |
| 44 | 44 |
#define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */ |