Mercurial > libavformat.hg
changeset 2274:b21c2af60bc9 libavformat
Replace all occurrences of AVERROR_IO with AVERROR(EIO).
author | takis |
---|---|
date | Thu, 19 Jul 2007 15:23:32 +0000 |
parents | 7eb456c4ed8a |
children | 7192ab16a21a |
files | 4xm.c aiff.c amr.c apc.c asf.c au.c audio.c avio.c aviobuf.c avisynth.c avs.c bethsoftvid.c c93.c daud.c dsicin.c dv.c dv1394.c dxa.c electronicarts.c flic.c flvdec.c gif.c gifdec.c grab.c gxf.c http.c idcin.c idroq.c img2.c ipmovie.c matroskadec.c mm.c mmf.c mp3.c mpc.c mpeg.c mpegts.c mtv.c mxf.c nuv.c ogg.c ogg2.c psxstr.c raw.c rmdec.c rtp.c rtpproto.c rtsp.c segafilm.c sierravmd.c smacker.c swf.c tcp.c thp.c tiertexseq.c txd.c udp.c utils.c v4l2.c vocdec.c wav.c wc3movie.c westwood.c wv.c x11grab.c yuv4mpeg.c |
diffstat | 66 files changed, 250 insertions(+), 250 deletions(-) [+] |
line wrap: on
line diff
--- a/4xm.c Thu Jul 19 15:21:30 2007 +0000 +++ b/4xm.c Thu Jul 19 15:23:32 2007 +0000 @@ -118,7 +118,7 @@ if (!header) return AVERROR(ENOMEM); if (get_buffer(pb, header, header_size) != header_size) - return AVERROR_IO; + return AVERROR(EIO); /* take the lazy approach and search for any and all vtrk and strk chunks */ for (i = 0; i < header_size - 8; i++) { @@ -235,7 +235,7 @@ fourcc_tag = AV_RL32(&header[0]); size = AV_RL32(&header[4]); if (url_feof(pb)) - return AVERROR_IO; + return AVERROR(EIO); switch (fourcc_tag) { case LIST_TAG: @@ -253,7 +253,7 @@ /* allocate 8 more bytes than 'size' to account for fourcc * and size */ if (size + 8 < size || av_new_packet(pkt, size + 8)) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = fourxm->video_stream_index; pkt->pts = fourxm->video_pts; pkt->pos = url_ftell(&s->pb); @@ -275,7 +275,7 @@ if (track_number == fourxm->selected_track) { ret= av_get_packet(&s->pb, pkt, size); if(ret<0) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = fourxm->tracks[fourxm->selected_track].stream_index; pkt->pts = fourxm->audio_pts;
--- a/aiff.c Thu Jul 19 15:21:30 2007 +0000 +++ b/aiff.c Thu Jul 19 15:23:32 2007 +0000 @@ -64,7 +64,7 @@ int size; if (url_feof(pb)) - return AVERROR_IO; + return AVERROR(EIO); *tag = get_le32(pb); size = get_be32(pb); @@ -400,7 +400,7 @@ /* End of stream may be reached */ if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); /* Now for that packet */ res = av_get_packet(&s->pb, pkt, (MAX_SIZE / st->codec->block_align) * st->codec->block_align);
--- a/amr.c Thu Jul 19 15:21:30 2007 +0000 +++ b/amr.c Thu Jul 19 15:23:32 2007 +0000 @@ -122,7 +122,7 @@ if (url_feof(&s->pb)) { - return AVERROR_IO; + return AVERROR(EIO); } //FIXME this is wrong, this should rather be in a AVParset @@ -148,7 +148,7 @@ if ( (size==0) || av_new_packet(pkt, size)) { - return AVERROR_IO; + return AVERROR(EIO); } pkt->stream_index = 0; @@ -160,7 +160,7 @@ if (read != size-1) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } return 0;
--- a/apc.c Thu Jul 19 15:21:30 2007 +0000 +++ b/apc.c Thu Jul 19 15:23:32 2007 +0000 @@ -75,7 +75,7 @@ static int apc_read_packet(AVFormatContext *s, AVPacket *pkt) { if (av_get_packet(&s->pb, pkt, MAX_READ_SIZE) <= 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = 0; return 0; }
--- a/asf.c Thu Jul 19 15:21:30 2007 +0000 +++ b/asf.c Thu Jul 19 15:23:32 2007 +0000 @@ -714,7 +714,7 @@ //static int pc = 0; for (;;) { if(url_feof(pb)) - return AVERROR_IO; + return AVERROR(EIO); if (asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1) { //asf->packet_size_left <= asf->packet_padsize) { @@ -727,7 +727,7 @@ asf->packet_pos= url_ftell(&s->pb); if (asf->data_object_size != (uint64_t)-1 && (asf->packet_pos - asf->data_object_offset >= asf->data_object_size)) - return AVERROR_IO; /* Do not exceed the size of the data object */ + return AVERROR(EIO); /* Do not exceed the size of the data object */ ret = asf_get_packet(s); //printf("READ ASF PACKET %d r:%d c:%d\n", ret, asf->packet_size_left, pc++); if (ret < 0)
--- a/au.c Thu Jul 19 15:21:30 2007 +0000 +++ b/au.c Thu Jul 19 15:23:32 2007 +0000 @@ -159,10 +159,10 @@ int ret; if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); ret= av_get_packet(&s->pb, pkt, MAX_SIZE); if (ret < 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = 0; /* note: we need to modify the packet size here to handle the last
--- a/audio.c Thu Jul 19 15:21:30 2007 +0000 +++ b/audio.c Thu Jul 19 15:23:32 2007 +0000 @@ -59,7 +59,7 @@ 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 @@ 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 @@ return 0; fail: close(audio_fd); - return AVERROR_IO; + return AVERROR(EIO); } static int audio_close(AudioData *s) @@ -160,7 +160,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ } if (!(ret == 0 || (ret == -1 && (errno == EAGAIN || errno == EINTR)))) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } } pkt->size = ret;
--- a/avio.c Thu Jul 19 15:21:30 2007 +0000 +++ b/avio.c Thu Jul 19 15:23:32 2007 +0000 @@ -101,7 +101,7 @@ { int ret; if (h->flags & URL_WRONLY) - return AVERROR_IO; + return AVERROR(EIO); ret = h->prot->url_read(h, buf, size); return ret; } @@ -111,10 +111,10 @@ { int ret; if (!(h->flags & (URL_WRONLY | URL_RDWR))) - return AVERROR_IO; + return AVERROR(EIO); /* avoid sending too big packets */ if (h->max_packet_size && size > h->max_packet_size) - return AVERROR_IO; + return AVERROR(EIO); ret = h->prot->url_write(h, buf, size); return ret; }
--- a/aviobuf.c Thu Jul 19 15:21:30 2007 +0000 +++ b/aviobuf.c Thu Jul 19 15:23:32 2007 +0000 @@ -514,7 +514,7 @@ (h->flags & URL_WRONLY || h->flags & URL_RDWR), h, url_read_packet, url_write_packet, url_seek_packet) < 0) { av_free(buffer); - return AVERROR_IO; + return AVERROR(EIO); } s->is_streamed = h->is_streamed; s->max_packet_size = max_packet_size;
--- a/avisynth.c Thu Jul 19 15:21:30 2007 +0000 +++ b/avisynth.c Thu Jul 19 15:23:32 2007 +0000 @@ -156,10 +156,10 @@ stream = &avs->streams[stream_id]; if (stream->read >= stream->info.dwLength) - return AVERROR_IO; + return AVERROR(EIO); if (av_new_packet(pkt, stream->chunck_size)) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = stream_id; pkt->pts = avs->streams[stream_id].read / avs->streams[stream_id].chunck_samples;
--- a/avs.c Thu Jul 19 15:21:30 2007 +0000 +++ b/avs.c Thu Jul 19 15:23:32 2007 +0000 @@ -106,7 +106,7 @@ ret = get_buffer(&s->pb, pkt->data + palette_size + 4, size - 4) + 4; if (ret < size) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->size = ret + palette_size; @@ -127,7 +127,7 @@ size = url_ftell(&s->pb) - size; avs->remaining_audio_size -= size; - if (ret == AVERROR_IO) + if (ret == AVERROR(EIO)) return 0; /* this indicate EOS */ if (ret < 0) return ret; @@ -154,7 +154,7 @@ while (1) { if (avs->remaining_frame_size <= 0) { if (!get_le16(&s->pb)) /* found EOF */ - return AVERROR_IO; + return AVERROR(EIO); avs->remaining_frame_size = get_le16(&s->pb) - 4; } @@ -168,7 +168,7 @@ case AVS_PALETTE: ret = get_buffer(&s->pb, palette, size - 4); if (ret < size - 4) - return AVERROR_IO; + return AVERROR(EIO); palette_size = size; break;
--- a/bethsoftvid.c Thu Jul 19 15:21:30 2007 +0000 +++ b/bethsoftvid.c Thu Jul 19 15:23:32 2007 +0000 @@ -179,7 +179,7 @@ int ret_value; if(vid->is_finished || url_feof(pb)) - return AVERROR_IO; + return AVERROR(EIO); block_type = get_byte(pb); switch(block_type){ @@ -188,7 +188,7 @@ ret_value = av_get_packet(pb, pkt, 3 * 256 + 1); if(ret_value != 3 * 256 + 1){ av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->stream_index = 0; return ret_value; @@ -202,7 +202,7 @@ audio_length = get_le16(pb); ret_value = av_get_packet(pb, pkt, audio_length); pkt->stream_index = 1; - return (ret_value != audio_length ? AVERROR_IO : ret_value); + return (ret_value != audio_length ? AVERROR(EIO) : ret_value); case VIDEO_P_FRAME: case VIDEO_YOFF_P_FRAME: @@ -214,7 +214,7 @@ if(vid->nframes != 0) av_log(s, AV_LOG_VERBOSE, "reached terminating character but not all frames read.\n"); vid->is_finished = 1; - return AVERROR_IO; + return AVERROR(EIO); default: av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n", block_type, block_type, block_type); return -1;
--- a/c93.c Thu Jul 19 15:21:30 2007 +0000 +++ b/c93.c Thu Jul 19 15:23:32 2007 +0000 @@ -129,7 +129,7 @@ } if (c93->current_frame >= br->frames) { if (c93->current_block >= 511 || !br[1].length) - return AVERROR_IO; + return AVERROR(EIO); br++; c93->current_block++; c93->current_frame = 0; @@ -154,7 +154,7 @@ ret = get_buffer(pb, pkt->data + 1, datasize); if (ret < datasize) { - ret = AVERROR_IO; + ret = AVERROR(EIO); goto fail; } @@ -168,7 +168,7 @@ pkt->data[0] |= C93_HAS_PALETTE; ret = get_buffer(pb, pkt->data + pkt->size, datasize); if (ret < datasize) { - ret = AVERROR_IO; + ret = AVERROR(EIO); goto fail; } pkt->size += 768;
--- a/daud.c Thu Jul 19 15:21:30 2007 +0000 +++ b/daud.c Thu Jul 19 15:23:32 2007 +0000 @@ -37,7 +37,7 @@ ByteIOContext *pb = &s->pb; int ret, size; if (url_feof(pb)) - return AVERROR_IO; + return AVERROR(EIO); size = get_be16(pb); get_be16(pb); // unknown ret = av_get_packet(pb, pkt, size);
--- a/dsicin.c Thu Jul 19 15:21:30 2007 +0000 +++ b/dsicin.c Thu Jul 19 15:23:32 2007 +0000 @@ -147,7 +147,7 @@ hdr->audio_frame_size = get_le32(pb); if (url_feof(pb) || url_ferror(pb)) - return AVERROR_IO; + return AVERROR(EIO); if (get_le32(pb) != 0xAA55AA55) return AVERROR_INVALIDDATA; @@ -189,7 +189,7 @@ pkt->data[3] = hdr->video_frame_type; if (get_buffer(pb, &pkt->data[4], pkt_size) != pkt_size) - return AVERROR_IO; + return AVERROR(EIO); /* sound buffer will be processed on next read_packet() call */ cin->audio_buffer_size = hdr->audio_frame_size; @@ -205,7 +205,7 @@ cin->audio_stream_pts += cin->audio_buffer_size * 2 / cin->file_header.audio_frame_size; if (get_buffer(pb, pkt->data, cin->audio_buffer_size) != cin->audio_buffer_size) - return AVERROR_IO; + return AVERROR(EIO); cin->audio_buffer_size = 0; return 0;
--- a/dv.c Thu Jul 19 15:21:30 2007 +0000 +++ b/dv.c Thu Jul 19 15:23:32 2007 +0000 @@ -388,7 +388,7 @@ if (get_buffer(&s->pb, c->buf, DV_PROFILE_BYTES) <= 0 || url_fseek(&s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0) - return AVERROR_IO; + return AVERROR(EIO); c->dv_demux->sys = dv_frame_profile(c->buf); s->bit_rate = av_rescale(c->dv_demux->sys->frame_size * 8, @@ -409,7 +409,7 @@ if (size < 0) { size = c->dv_demux->sys->frame_size; if (get_buffer(&s->pb, c->buf, size) <= 0) - return AVERROR_IO; + return AVERROR(EIO); size = dv_produce_packet(c->dv_demux, pkt, c->buf, size); }
--- a/dv1394.c Thu Jul 19 15:21:30 2007 +0000 +++ b/dv1394.c Thu Jul 19 15:23:32 2007 +0000 @@ -124,7 +124,7 @@ failed: close(dv->fd); - return AVERROR_IO; + return AVERROR(EIO); } static int dv1394_read_packet(AVFormatContext *context, AVPacket *pkt) @@ -163,12 +163,12 @@ if (errno == EAGAIN || errno == EINTR) goto restart_poll; perror("Poll failed"); - return AVERROR_IO; + return AVERROR(EIO); } if (ioctl(dv->fd, DV1394_GET_STATUS, &s) < 0) { perror("Failed to get status"); - return AVERROR_IO; + return AVERROR(EIO); } #ifdef DV1394_DEBUG av_log(context, AV_LOG_DEBUG, "DV1394: status\n"
--- a/dxa.c Thu Jul 19 15:21:30 2007 +0000 +++ b/dxa.c Thu Jul 19 15:23:32 2007 +0000 @@ -149,7 +149,7 @@ ret = av_get_packet(&s->pb, pkt, size); pkt->stream_index = 1; if(ret != size) - return AVERROR_IO; + return AVERROR(EIO); c->bytes_left -= size; c->wavpos = url_ftell(&s->pb); return 0; @@ -186,7 +186,7 @@ ret = get_buffer(&s->pb, pkt->data + DXA_EXTRA_SIZE + pal_size, size); if(ret != size){ av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } if(pal_size) memcpy(pkt->data, pal, pal_size); pkt->stream_index = 0;
--- a/electronicarts.c Thu Jul 19 15:21:30 2007 +0000 +++ b/electronicarts.c Thu Jul 19 15:23:32 2007 +0000 @@ -178,7 +178,7 @@ AVStream *st; if (!process_ea_header(s)) - return AVERROR_IO; + return AVERROR(EIO); #if 0 /* initialize the video decoder stream */ @@ -226,7 +226,7 @@ while (!packet_read) { if (get_buffer(pb, preamble, EA_PREAMBLE_SIZE) != EA_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); chunk_type = AV_RL32(&preamble[0]); chunk_size = AV_RL32(&preamble[4]) - EA_PREAMBLE_SIZE; @@ -235,7 +235,7 @@ case SCDl_TAG: ret = av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size) - ret = AVERROR_IO; + ret = AVERROR(EIO); else { pkt->stream_index = ea->audio_stream_index; pkt->pts = 90000; @@ -253,7 +253,7 @@ /* ending tag */ case SCEl_TAG: - ret = AVERROR_IO; + ret = AVERROR(EIO); packet_read = 1; break;
--- a/flic.c Thu Jul 19 15:21:30 2007 +0000 +++ b/flic.c Thu Jul 19 15:23:32 2007 +0000 @@ -78,7 +78,7 @@ /* load the whole header and pull out the width and height */ if (get_buffer(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE) - return AVERROR_IO; + return AVERROR(EIO); magic_number = AV_RL16(&header[4]); speed = AV_RL32(&header[0x10]); @@ -169,7 +169,7 @@ if ((ret = get_buffer(pb, preamble, FLIC_PREAMBLE_SIZE)) != FLIC_PREAMBLE_SIZE) { - ret = AVERROR_IO; + ret = AVERROR(EIO); break; } @@ -178,7 +178,7 @@ if (((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) && size > FLIC_PREAMBLE_SIZE) { if (av_new_packet(pkt, size)) { - ret = AVERROR_IO; + ret = AVERROR(EIO); break; } pkt->stream_index = flic->video_stream_index; @@ -189,7 +189,7 @@ size - FLIC_PREAMBLE_SIZE); if (ret != size - FLIC_PREAMBLE_SIZE) { av_free_packet(pkt); - ret = AVERROR_IO; + ret = AVERROR(EIO); } flic->pts += flic->frame_pts_inc; packet_read = 1;
--- a/flvdec.c Thu Jul 19 15:21:30 2007 +0000 +++ b/flvdec.c Thu Jul 19 15:23:32 2007 +0000 @@ -270,7 +270,7 @@ pts = get_be24(&s->pb); // av_log(s, AV_LOG_DEBUG, "type:%d, size:%d, pts:%d\n", type, size, pts); if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); url_fskip(&s->pb, 4); /* reserved */ flags = 0; @@ -348,7 +348,7 @@ ret= av_get_packet(&s->pb, pkt, size - 1); if (ret <= 0) { - return AVERROR_IO; + return AVERROR(EIO); } /* note: we need to modify the packet size here to handle the last packet */
--- a/gif.c Thu Jul 19 15:21:30 2007 +0000 +++ b/gif.c Thu Jul 19 15:23:32 2007 +0000 @@ -343,7 +343,7 @@ if (video_enc->pix_fmt != PIX_FMT_RGB24) { av_log(s, AV_LOG_ERROR, "ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.\n"); - return AVERROR_IO; + return AVERROR(EIO); } gif_image_write_header(pb, width, height, loop_count, NULL);
--- a/gifdec.c Thu Jul 19 15:21:30 2007 +0000 +++ b/gifdec.c Thu Jul 19 15:23:32 2007 +0000 @@ -500,21 +500,21 @@ switch (code) { case ',': if (gif_read_image(s) < 0) - return AVERROR_IO; + return AVERROR(EIO); ret = 0; goto the_end; case ';': /* end of image */ - ret = AVERROR_IO; + ret = AVERROR(EIO); goto the_end; case '!': if (gif_read_extension(s) < 0) - return AVERROR_IO; + return AVERROR(EIO); break; case EOF: default: /* error or errneous EOF */ - ret = AVERROR_IO; + ret = AVERROR(EIO); goto the_end; } } @@ -567,7 +567,7 @@ /* XXX: avoid copying */ if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) { - return AVERROR_IO; + return AVERROR(EIO); } pkt->stream_index = 0; memcpy(pkt->data, s->image_buf, s->screen_width * s->screen_height * 3);
--- a/grab.c Thu Jul 19 15:21:30 2007 +0000 +++ b/grab.c Thu Jul 19 15:23:32 2007 +0000 @@ -279,7 +279,7 @@ if (video_fd >= 0) close(video_fd); av_free(st); - return AVERROR_IO; + return AVERROR(EIO); } static int v4l_mm_read_picture(VideoData *s, uint8_t *buf) @@ -299,7 +299,7 @@ av_log(NULL, AV_LOG_ERROR, "Cannot Sync\n"); else perror("VIDIOCMCAPTURE"); - return AVERROR_IO; + return AVERROR(EIO); } /* This is now the grabbing frame */ @@ -334,7 +334,7 @@ } if (av_new_packet(pkt, s->frame_size) < 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->pts = curtime; @@ -345,7 +345,7 @@ return v4l_mm_read_picture(s, pkt->data); } else { if (read(s->fd, pkt->data, pkt->size) != pkt->size) - return AVERROR_IO; + return AVERROR(EIO); return s->frame_size; } }
--- a/gxf.c Thu Jul 19 15:21:30 2007 +0000 +++ b/gxf.c Thu Jul 19 15:23:32 2007 +0000 @@ -473,7 +473,7 @@ pkt->dts = field_nr; return ret; } - return AVERROR_IO; + return AVERROR(EIO); } static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {
--- a/http.c Thu Jul 19 15:21:30 2007 +0000 +++ b/http.c Thu Jul 19 15:23:32 2007 +0000 @@ -101,7 +101,7 @@ /* url moved, get next */ url_close(hd); if (redirects++ >= MAX_REDIRECTS) - return AVERROR_IO; + return AVERROR(EIO); location_changed = 0; goto redo; } @@ -109,7 +109,7 @@ fail: if (hd) url_close(hd); - return AVERROR_IO; + return AVERROR(EIO); } static int http_open(URLContext *h, const char *uri, int flags) @@ -139,7 +139,7 @@ if (s->buf_ptr >= s->buf_end) { len = url_read(s->hd, s->buffer, BUFFER_SIZE); if (len < 0) { - return AVERROR_IO; + return AVERROR(EIO); } else if (len == 0) { return -1; } else { @@ -237,7 +237,7 @@ av_freep(&auth_b64); if (http_write(h, s->buffer, strlen(s->buffer)) < 0) - return AVERROR_IO; + return AVERROR(EIO); /* init input buffer */ s->buf_ptr = s->buffer; @@ -255,7 +255,7 @@ for(;;) { ch = http_getc(s); if (ch < 0) - return AVERROR_IO; + return AVERROR(EIO); if (ch == '\n') { /* process line */ if (q > line && q[-1] == '\r')
--- a/idcin.c Thu Jul 19 15:21:30 2007 +0000 +++ b/idcin.c Thu Jul 19 15:23:32 2007 +0000 @@ -165,7 +165,7 @@ st->codec->extradata = av_malloc(HUFFMAN_TABLE_SIZE); if (get_buffer(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE) != HUFFMAN_TABLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); /* save a reference in order to transport the palette */ st->codec->palctrl = &idcin->palctrl; @@ -222,17 +222,17 @@ unsigned char palette_buffer[768]; if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); if (idcin->next_chunk_is_video) { command = get_le32(pb); if (command == 2) { - return AVERROR_IO; + return AVERROR(EIO); } else if (command == 1) { /* trigger a palette change */ idcin->palctrl.palette_changed = 1; if (get_buffer(pb, palette_buffer, 768) != 768) - return AVERROR_IO; + return AVERROR(EIO); /* scale the palette as necessary */ palette_scale = 2; for (i = 0; i < 768; i++) @@ -255,7 +255,7 @@ chunk_size -= 4; ret= av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = idcin->video_stream_index; pkt->pts = idcin->pts; } else { @@ -266,7 +266,7 @@ chunk_size = idcin->audio_chunk_size1; ret= av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = idcin->audio_stream_index; pkt->pts = idcin->pts;
--- a/idroq.c Thu Jul 19 15:21:30 2007 +0000 +++ b/idroq.c Thu Jul 19 15:23:32 2007 +0000 @@ -79,7 +79,7 @@ /* get the main header */ if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); roq->framerate = AV_RL16(&preamble[6]); roq->frame_pts_inc = 90000 / roq->framerate; @@ -91,7 +91,7 @@ for (i = 0; i < RoQ_CHUNKS_TO_SCAN; i++) { if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); chunk_type = AV_RL16(&preamble[0]); chunk_size = AV_RL32(&preamble[2]); @@ -102,7 +102,7 @@ /* fetch the width and height; reuse the preamble bytes */ if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); roq->width = AV_RL16(&preamble[0]); roq->height = AV_RL16(&preamble[2]); break; @@ -186,12 +186,12 @@ while (!packet_read) { if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); /* get the next chunk preamble */ if ((ret = get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE)) != RoQ_CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); chunk_type = AV_RL16(&preamble[0]); chunk_size = AV_RL32(&preamble[2]); @@ -212,7 +212,7 @@ url_fseek(pb, codebook_size, SEEK_CUR); if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) != RoQ_CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); chunk_size = AV_RL32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 + codebook_size; @@ -222,7 +222,7 @@ /* load up the packet */ ret= av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = roq->video_stream_index; pkt->pts = roq->video_pts; @@ -235,7 +235,7 @@ case RoQ_QUAD_VQ: /* load up the packet */ if (av_new_packet(pkt, chunk_size + RoQ_CHUNK_PREAMBLE_SIZE)) - return AVERROR_IO; + return AVERROR(EIO); /* copy over preamble */ memcpy(pkt->data, preamble, RoQ_CHUNK_PREAMBLE_SIZE); @@ -255,7 +255,7 @@ ret = get_buffer(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE, chunk_size); if (ret != chunk_size) - ret = AVERROR_IO; + ret = AVERROR(EIO); packet_read = 1; break;
--- a/img2.c Thu Jul 19 15:21:30 2007 +0000 +++ b/img2.c Thu Jul 19 15:23:32 2007 +0000 @@ -208,7 +208,7 @@ if (!s->is_pipe) { if (find_image_range(&first_index, &last_index, s->path) < 0) - return AVERROR_IO; + return AVERROR(EIO); s->img_first = first_index; s->img_last = last_index; s->img_number = first_index; @@ -249,10 +249,10 @@ } if (av_get_frame_filename(filename, sizeof(filename), s->path, s->img_number)<0 && s->img_number > 1) - return AVERROR_IO; + return AVERROR(EIO); for(i=0; i<3; i++){ if (url_fopen(f[i], filename, URL_RDONLY) < 0) - return AVERROR_IO; + return AVERROR(EIO); size[i]= url_fsize(f[i]); if(codec->codec_id != CODEC_ID_RAWVIDEO) @@ -265,7 +265,7 @@ } else { f[0] = &s1->pb; if (url_feof(f[0])) - return AVERROR_IO; + return AVERROR(EIO); size[0]= 4096; } @@ -286,7 +286,7 @@ if (ret[0] <= 0 || ret[1]<0 || ret[2]<0) { av_free_packet(pkt); - return AVERROR_IO; /* signal EOF */ + return AVERROR(EIO); /* signal EOF */ } else { s->img_count++; s->img_number++; @@ -330,10 +330,10 @@ if (!img->is_pipe) { if (av_get_frame_filename(filename, sizeof(filename), img->path, img->img_number) < 0 && img->img_number>1) - return AVERROR_IO; + return AVERROR(EIO); for(i=0; i<3; i++){ if (url_fopen(pb[i], filename, URL_WRONLY) < 0) - return AVERROR_IO; + return AVERROR(EIO); if(codec->codec_id != CODEC_ID_RAWVIDEO) break;
--- a/ipmovie.c Thu Jul 19 15:21:30 2007 +0000 +++ b/ipmovie.c Thu Jul 19 15:23:32 2007 +0000 @@ -539,7 +539,7 @@ * it; if it is the first video chunk, this is a silent file */ if (get_buffer(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) != CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); chunk_type = AV_RL16(&chunk_preamble[2]); url_fseek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR); @@ -596,7 +596,7 @@ if (ret == CHUNK_BAD) ret = AVERROR_INVALIDDATA; else if (ret == CHUNK_EOF) - ret = AVERROR_IO; + ret = AVERROR(EIO); else if (ret == CHUNK_NOMEM) ret = AVERROR(ENOMEM); else if (ret == CHUNK_VIDEO)
--- a/matroskadec.c Thu Jul 19 15:21:30 2007 +0000 +++ b/matroskadec.c Thu Jul 19 15:23:32 2007 +0000 @@ -223,7 +223,7 @@ "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); } - return AVERROR_IO; /* EOS or actual I/O error */ + return AVERROR(EIO); /* EOS or actual I/O error */ } /* get the length of the EBML number */ @@ -491,7 +491,7 @@ offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); - return AVERROR_IO; + return AVERROR(EIO); } (*str)[size] = '\0'; @@ -588,7 +588,7 @@ offset_t pos = url_ftell(pb); av_log(matroska->ctx, AV_LOG_ERROR, "Read error at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos); - return AVERROR_IO; + return AVERROR(EIO); } return 0; @@ -693,7 +693,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &level_up))) - return AVERROR_IO; + return AVERROR(EIO); /* end-of-header */ if (level_up) @@ -903,7 +903,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1002,7 +1002,7 @@ /* try reading the trackentry headers */ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up > 0) { matroska->level_up--; @@ -1075,7 +1075,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up > 0) { matroska->level_up--; @@ -1246,7 +1246,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up > 0) { matroska->level_up--; @@ -1444,7 +1444,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1487,7 +1487,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1508,7 +1508,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1535,7 +1535,7 @@ while (res == 0) { if (!(id = ebml_peek_id (matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1642,7 +1642,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1680,7 +1680,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1697,7 +1697,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -1913,7 +1913,7 @@ /* The next thing is a segment. */ while (1) { if (!(id = ebml_peek_id(matroska, &last_level))) - return AVERROR_IO; + return AVERROR(EIO); if (id == MATROSKA_ID_SEGMENT) break; @@ -1936,7 +1936,7 @@ /* we've found our segment, start reading the different contents in here */ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -2497,7 +2497,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -2575,7 +2575,7 @@ while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - res = AVERROR_IO; + res = AVERROR(EIO); break; } else if (matroska->level_up) { matroska->level_up--; @@ -2640,12 +2640,12 @@ /* Have we already reached the end? */ if (matroska->done) - return AVERROR_IO; + return AVERROR(EIO); res = 0; while (res == 0) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { - return AVERROR_IO; + return AVERROR(EIO); } else if (matroska->level_up) { matroska->level_up--; break;
--- a/mm.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mm.c Thu Jul 19 15:23:32 2007 +0000 @@ -136,7 +136,7 @@ while(1) { if (get_buffer(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE) { - return AVERROR_IO; + return AVERROR(EIO); } type = AV_RL16(&preamble[0]); @@ -146,7 +146,7 @@ case MM_TYPE_PALETTE : url_fseek(pb, 4, SEEK_CUR); /* unknown data */ if (get_buffer(pb, pal, MM_PALETTE_SIZE) != MM_PALETTE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); url_fseek(pb, length - (4 + MM_PALETTE_SIZE), SEEK_CUR); for (i=0; i<MM_PALETTE_COUNT; i++) { @@ -171,7 +171,7 @@ return AVERROR(ENOMEM); memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE); if (get_buffer(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length) - return AVERROR_IO; + return AVERROR(EIO); pkt->size = length + MM_PREAMBLE_SIZE; pkt->stream_index = 0; pkt->pts = mm->video_pts++;
--- a/mmf.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mmf.c Thu Jul 19 15:23:32 2007 +0000 @@ -266,7 +266,7 @@ int ret, size; if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); st = s->streams[0]; size = MAX_SIZE; @@ -274,10 +274,10 @@ size = mmf->data_size; if(!size) - return AVERROR_IO; + return AVERROR(EIO); if (av_new_packet(pkt, size)) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = 0; ret = get_buffer(&s->pb, pkt->data, pkt->size);
--- a/mp3.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mp3.c Thu Jul 19 15:23:32 2007 +0000 @@ -485,7 +485,7 @@ pkt->stream_index = 0; if (ret <= 0) { - return AVERROR_IO; + return AVERROR(EIO); } /* note: we need to modify the packet size here to handle the last packet */
--- a/mpc.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mpc.c Thu Jul 19 15:23:32 2007 +0000 @@ -148,7 +148,7 @@ c->curbits = (curbits + size2) & 0x1F; if (av_new_packet(pkt, size) < 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->data[0] = curbits; pkt->data[1] = (c->curframe > c->fcount); @@ -160,7 +160,7 @@ url_fseek(&s->pb, -4, SEEK_CUR); if(ret < size){ av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->size = ret + 4;
--- a/mpeg.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mpeg.c Thu Jul 19 15:23:32 2007 +0000 @@ -232,7 +232,7 @@ last_sync = url_ftell(&s->pb); //printf("startcode=%x pos=0x%"PRIx64"\n", startcode, url_ftell(&s->pb)); if (startcode < 0) - return AVERROR_IO; + return AVERROR(EIO); if (startcode == PACK_START_CODE) goto redo; if (startcode == SYSTEM_HEADER_START_CODE)
--- a/mpegts.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mpegts.c Thu Jul 19 15:23:32 2007 +0000 @@ -1014,7 +1014,7 @@ for(;;) { len = get_buffer(pb, buf, TS_PACKET_SIZE); if (len != TS_PACKET_SIZE) - return AVERROR_IO; + return AVERROR(EIO); /* check paquet sync byte */ if (buf[0] != 0x47) { /* find a new packet start */
--- a/mtv.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mtv.c Thu Jul 19 15:23:32 2007 +0000 @@ -122,7 +122,7 @@ /* Jump over header */ if(url_fseek(pb, MTV_HEADER_SIZE, SEEK_SET) != MTV_HEADER_SIZE) - return AVERROR_IO; + return AVERROR(EIO); return(0); @@ -145,7 +145,7 @@ ret = av_get_packet(pb, pkt, MTV_ASUBCHUNK_DATA_SIZE); if(ret != MTV_ASUBCHUNK_DATA_SIZE) - return AVERROR_IO; + return AVERROR(EIO); mtv->audio_packet_count++; pkt->stream_index = AUDIO_SID; @@ -154,7 +154,7 @@ { ret = av_get_packet(pb, pkt, mtv->img_segment_size); if(ret != mtv->img_segment_size) - return AVERROR_IO; + return AVERROR(EIO); #ifndef WORDS_BIGENDIAN
--- a/mxf.c Thu Jul 19 15:21:30 2007 +0000 +++ b/mxf.c Thu Jul 19 15:23:32 2007 +0000 @@ -361,7 +361,7 @@ } else url_fskip(&s->pb, klv.length); } - return AVERROR_IO; + return AVERROR(EIO); } static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set)
--- a/nuv.c Thu Jul 19 15:21:30 2007 +0000 +++ b/nuv.c Thu Jul 19 15:23:32 2007 +0000 @@ -225,7 +225,7 @@ break; } } - return AVERROR_IO; + return AVERROR(EIO); } AVInputFormat nuv_demuxer = {
--- a/ogg.c Thu Jul 19 15:21:30 2007 +0000 +++ b/ogg.c Thu Jul 19 15:23:32 2007 +0000 @@ -205,7 +205,7 @@ buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ; if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0) - return AVERROR_IO ; + return AVERROR(EIO) ; ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ; ogg_sync_pageout(&context->oy, &og) ; @@ -245,9 +245,9 @@ ogg_packet op ; if(next_packet(avfcontext, &op)) - return AVERROR_IO ; + return AVERROR(EIO) ; if(av_new_packet(pkt, op.bytes) < 0) - return AVERROR_IO ; + return AVERROR(EIO) ; pkt->stream_index = 0 ; memcpy(pkt->data, op.packet, op.bytes); if(avfcontext->streams[0]->codec.sample_rate && op.granulepos!=-1)
--- a/ogg2.c Thu Jul 19 15:21:30 2007 +0000 +++ b/ogg2.c Thu Jul 19 15:23:32 2007 +0000 @@ -540,7 +540,7 @@ //Get an ogg packet do{ if (ogg_packet (s, &idx, &pstart, &psize) < 0) - return AVERROR_IO; + return AVERROR(EIO); }while (idx < 0 || !s->streams[idx]); ogg = s->priv_data; @@ -548,7 +548,7 @@ //Alloc a pkt if (av_new_packet (pkt, psize) < 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = idx; memcpy (pkt->data, os->buf + pstart, psize); if (os->lastgp != -1LL){
--- a/psxstr.c Thu Jul 19 15:21:30 2007 +0000 +++ b/psxstr.c Thu Jul 19 15:23:32 2007 +0000 @@ -142,7 +142,7 @@ /* skip over any RIFF header */ if (get_buffer(pb, sector, RIFF_HEADER_SIZE) != RIFF_HEADER_SIZE) - return AVERROR_IO; + return AVERROR(EIO); if (AV_RL32(§or[0]) == RIFF_TAG) start = RIFF_HEADER_SIZE; else @@ -153,7 +153,7 @@ /* check through the first 32 sectors for individual channels */ for (i = 0; i < 32; i++) { if (get_buffer(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE) - return AVERROR_IO; + return AVERROR(EIO); //printf("%02x %02x %02x %02x\n",sector[0x10],sector[0x11],sector[0x12],sector[0x13]); @@ -260,7 +260,7 @@ while (!packet_read) { if (get_buffer(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE) - return AVERROR_IO; + return AVERROR(EIO); channel = sector[0x11]; if (channel >= 32) @@ -282,7 +282,7 @@ pkt = &str->tmp_pkt; if (current_sector == 0) { if (av_new_packet(pkt, frame_size)) - return AVERROR_IO; + return AVERROR(EIO); pkt->pos= url_ftell(pb) - RAW_CD_SECTOR_SIZE; pkt->stream_index = @@ -319,7 +319,7 @@ if (channel == str->audio_channel) { pkt = ret_pkt; if (av_new_packet(pkt, 2304)) - return AVERROR_IO; + return AVERROR(EIO); memcpy(pkt->data,sector+24,2304); pkt->stream_index = @@ -338,7 +338,7 @@ } if (url_feof(pb)) - return AVERROR_IO; + return AVERROR(EIO); } return ret;
--- a/raw.c Thu Jul 19 15:21:30 2007 +0000 +++ b/raw.c Thu Jul 19 15:23:32 2007 +0000 @@ -115,7 +115,7 @@ pkt->stream_index = 0; if (ret <= 0) { - return AVERROR_IO; + return AVERROR(EIO); } /* note: we need to modify the packet size here to handle the last packet */ @@ -130,14 +130,14 @@ size = RAW_PACKET_SIZE; if (av_new_packet(pkt, size) < 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->pos= url_ftell(&s->pb); pkt->stream_index = 0; ret = get_partial_buffer(&s->pb, pkt->data, size); if (ret <= 0) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->size = ret; return ret; @@ -149,7 +149,7 @@ int ret, size, w, h, unk1, unk2; if (get_le32(&s->pb) != MKTAG('M', 'J', 'P', 'G')) - return AVERROR_IO; // FIXME + return AVERROR(EIO); // FIXME size = get_le32(&s->pb); @@ -166,14 +166,14 @@ size, w, h, unk1, unk2); if (av_new_packet(pkt, size) < 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->pos = url_ftell(&s->pb); pkt->stream_index = 0; ret = get_buffer(&s->pb, pkt->data, size); if (ret <= 0) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->size = ret; return ret; @@ -848,7 +848,7 @@ pkt->stream_index = 0; if (ret != packet_size) { - return AVERROR_IO; + return AVERROR(EIO); } else { return 0; }
--- a/rmdec.c Thu Jul 19 15:21:30 2007 +0000 +++ b/rmdec.c Thu Jul 19 15:23:32 2007 +0000 @@ -220,7 +220,7 @@ /* very old .ra format */ return rm_read_header_old(s, ap); } else if (tag != MKTAG('.', 'R', 'M', 'F')) { - return AVERROR_IO; + return AVERROR(EIO); } get_be32(pb); /* header size */ @@ -359,7 +359,7 @@ for(i=0;i<s->nb_streams;i++) { av_free(s->streams[i]); } - return AVERROR_IO; + return AVERROR(EIO); } static int get_num(ByteIOContext *pb, int *len) @@ -468,7 +468,7 @@ for (y = 0; y < rm->sub_packet_h; y++) for (x = 0; x < rm->sub_packet_h/2; x++) if (get_buffer(pb, rm->audiobuf+x*2*rm->audio_framesize+y*rm->coded_framesize, rm->coded_framesize) <= 0) - return AVERROR_IO; + return AVERROR(EIO); rm->audio_stream_num = 0; rm->audio_pkt_cnt = rm->sub_packet_h * rm->audio_framesize / st->codec->block_align - 1; // Release first audio packet @@ -482,7 +482,7 @@ len= av_get_packet(pb, pkt, len); pkt->stream_index = 0; if (len <= 0) { - return AVERROR_IO; + return AVERROR(EIO); } pkt->size = len; } @@ -491,7 +491,7 @@ resync: len=sync(s, ×tamp, &flags, &i, &pos); if(len<0) - return AVERROR_IO; + return AVERROR(EIO); st = s->streams[i]; if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
--- a/rtp.c Thu Jul 19 15:21:30 2007 +0000 +++ b/rtp.c Thu Jul 19 15:23:32 2007 +0000 @@ -741,7 +741,7 @@ max_packet_size = url_fget_max_packet_size(&s1->pb); if (max_packet_size <= 12) - return AVERROR_IO; + return AVERROR(EIO); s->max_payload_size = max_packet_size - 12; switch(st->codec->codec_id) {
--- a/rtpproto.c Thu Jul 19 15:21:30 2007 +0000 +++ b/rtpproto.c Thu Jul 19 15:23:32 2007 +0000 @@ -163,7 +163,7 @@ if (s->rtcp_hd) url_close(s->rtcp_hd); av_free(s); - return AVERROR_IO; + return AVERROR(EIO); } static int rtp_read(URLContext *h, uint8_t *buf, int size) @@ -182,7 +182,7 @@ if (ff_neterrno() == FF_NETERROR(EAGAIN) || ff_neterrno() == FF_NETERROR(EINTR)) continue; - return AVERROR_IO; + return AVERROR(EIO); } break; } @@ -206,7 +206,7 @@ if (ff_neterrno() == FF_NETERROR(EAGAIN) || ff_neterrno() == FF_NETERROR(EINTR)) continue; - return AVERROR_IO; + return AVERROR(EIO); } break; } @@ -219,7 +219,7 @@ if (ff_neterrno() == FF_NETERROR(EAGAIN) || ff_neterrno() == FF_NETERROR(EINTR)) continue; - return AVERROR_IO; + return AVERROR(EIO); } break; }
--- a/rtsp.c Thu Jul 19 15:21:30 2007 +0000 +++ b/rtsp.c Thu Jul 19 15:23:32 2007 +0000 @@ -886,7 +886,7 @@ /* open the tcp connexion */ snprintf(tcpname, sizeof(tcpname), "tcp://%s:%d", host, port); if (url_open(&rtsp_hd, tcpname, URL_RDWR) < 0) - return AVERROR_IO; + return AVERROR(EIO); rt->rtsp_hd = rtsp_hd; rt->seq = 0; @@ -1199,7 +1199,7 @@ break; } if (len < 0) - return AVERROR_IO; + return AVERROR(EIO); ret = rtp_parse_packet(rtsp_st->rtp_ctx, pkt, buf, len); if (ret < 0) goto redo; @@ -1473,7 +1473,7 @@ } *ic_ptr = ic; if (!ic) - return AVERROR_IO; + return AVERROR(EIO); else return 0; }
--- a/segafilm.c Thu Jul 19 15:21:30 2007 +0000 +++ b/segafilm.c Thu Jul 19 15:23:32 2007 +0000 @@ -89,7 +89,7 @@ /* load the main FILM header */ if (get_buffer(pb, scratch, 16) != 16) - return AVERROR_IO; + return AVERROR(EIO); data_offset = AV_RB32(&scratch[4]); film->version = AV_RB32(&scratch[8]); @@ -97,7 +97,7 @@ if (film->version == 0) { /* special case for Lemmings .film files; 20-byte header */ if (get_buffer(pb, scratch, 20) != 20) - return AVERROR_IO; + return AVERROR(EIO); /* make some assumptions about the audio parameters */ film->audio_type = CODEC_ID_PCM_S8; film->audio_samplerate = 22050; @@ -106,7 +106,7 @@ } else { /* normal Saturn .cpk files; 32-byte header */ if (get_buffer(pb, scratch, 32) != 32) - return AVERROR_IO; + return AVERROR(EIO); film->audio_samplerate = AV_RB16(&scratch[24]);; film->audio_channels = scratch[21]; film->audio_bits = scratch[22]; @@ -158,7 +158,7 @@ /* load the sample table */ if (get_buffer(pb, scratch, 16) != 16) - return AVERROR_IO; + return AVERROR(EIO); if (AV_RB32(&scratch[0]) != STAB_TAG) return AVERROR_INVALIDDATA; film->base_clock = AV_RB32(&scratch[8]); @@ -175,7 +175,7 @@ /* load the next sample record and transfer it to an internal struct */ if (get_buffer(pb, scratch, 16) != 16) { av_free(film->sample_table); - return AVERROR_IO; + return AVERROR(EIO); } film->sample_table[i].sample_offset = data_offset + AV_RB32(&scratch[0]); @@ -211,7 +211,7 @@ int left, right; if (film->current_sample >= film->sample_count) - return AVERROR_IO; + return AVERROR(EIO); sample = &film->sample_table[film->current_sample]; @@ -242,7 +242,7 @@ pkt->pos= url_ftell(pb); ret = get_buffer(pb, film->stereo_buffer, sample->sample_size); if (ret != sample->sample_size) - ret = AVERROR_IO; + ret = AVERROR(EIO); left = 0; right = sample->sample_size / 2; @@ -260,7 +260,7 @@ } else { ret= av_get_packet(pb, pkt, sample->sample_size); if (ret != sample->sample_size) - ret = AVERROR_IO; + ret = AVERROR(EIO); } pkt->stream_index = sample->stream;
--- a/sierravmd.c Thu Jul 19 15:21:30 2007 +0000 +++ b/sierravmd.c Thu Jul 19 15:23:32 2007 +0000 @@ -89,7 +89,7 @@ /* fetch the main header, including the 2 header length bytes */ url_fseek(pb, 0, SEEK_SET); if (get_buffer(pb, vmd->vmd_header, VMD_HEADER_SIZE) != VMD_HEADER_SIZE) - return AVERROR_IO; + return AVERROR(EIO); /* start up the decoders */ vst = av_new_stream(s, 0); @@ -161,7 +161,7 @@ raw_frame_table_size) { av_free(raw_frame_table); av_free(vmd->frame_table); - return AVERROR_IO; + return AVERROR(EIO); } total_frames = 0; @@ -250,7 +250,7 @@ vmd_frame_t *frame; if (vmd->current_frame >= vmd->frame_count) - return AVERROR_IO; + return AVERROR(EIO); frame = &vmd->frame_table[vmd->current_frame]; /* position the stream (will probably be there already) */ @@ -265,7 +265,7 @@ if (ret != frame->frame_size) { av_free_packet(pkt); - ret = AVERROR_IO; + ret = AVERROR(EIO); } pkt->stream_index = frame->stream_index; pkt->pts = frame->pts;
--- a/smacker.c Thu Jul 19 15:21:30 2007 +0000 +++ b/smacker.c Thu Jul 19 15:23:32 2007 +0000 @@ -199,7 +199,7 @@ if(ret != st->codec->extradata_size - 16){ av_free(smk->frm_size); av_free(smk->frm_flags); - return AVERROR_IO; + return AVERROR(EIO); } ((int32_t*)st->codec->extradata)[0] = le2me_32(smk->mmap_size); ((int32_t*)st->codec->extradata)[1] = le2me_32(smk->mclr_size); @@ -284,7 +284,7 @@ smk->buf_sizes[smk->curstream] = size; ret = get_buffer(&s->pb, smk->bufs[smk->curstream], size); if(ret != size) - return AVERROR_IO; + return AVERROR(EIO); smk->stream_id[smk->curstream] = smk->indexes[i]; } flags >>= 1; @@ -297,7 +297,7 @@ memcpy(pkt->data + 1, smk->pal, 768); ret = get_buffer(&s->pb, pkt->data + 769, frame_size); if(ret != frame_size) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = smk->videoindex; pkt->size = ret + 769; smk->cur_frame++;
--- a/swf.c Thu Jul 19 15:21:30 2007 +0000 +++ b/swf.c Thu Jul 19 15:23:32 2007 +0000 @@ -639,10 +639,10 @@ if (tag == MKBETAG('C', 'W', 'S', 0)) { av_log(s, AV_LOG_ERROR, "Compressed SWF format not supported\n"); - return AVERROR_IO; + return AVERROR(EIO); } if (tag != MKBETAG('F', 'W', 'S', 0)) - return AVERROR_IO; + return AVERROR(EIO); get_le32(pb); /* skip rectangle size */ nbits = get_byte(pb) >> 3; @@ -684,7 +684,7 @@ ast->need_parsing = AVSTREAM_PARSE_FULL; sample_rate_code= (v>>2) & 3; if (!sample_rate_code) - return AVERROR_IO; + return AVERROR(EIO); ast->codec->sample_rate = 11025 << (sample_rate_code-1); av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); if (len > 4) @@ -715,7 +715,7 @@ for(;;) { tag = get_swf_tag(pb, &len); if (tag < 0) - return AVERROR_IO; + return AVERROR(EIO); if (tag == TAG_VIDEOFRAME) { int ch_id = get_le16(pb); len -= 2;
--- a/tcp.c Thu Jul 19 15:21:30 2007 +0000 +++ b/tcp.c Thu Jul 19 15:23:32 2007 +0000 @@ -98,7 +98,7 @@ return 0; fail: - ret = AVERROR_IO; + ret = AVERROR(EIO); fail1: if (fd >= 0) closesocket(fd);
--- a/thp.c Thu Jul 19 15:21:30 2007 +0000 +++ b/thp.c Thu Jul 19 15:23:32 2007 +0000 @@ -148,7 +148,7 @@ if (thp->audiosize == 0) { /* Terminate when last frame is reached. */ if (thp->frame >= thp->framecnt) - return AVERROR_IO; + return AVERROR(EIO); url_fseek(pb, thp->next_frame, SEEK_SET); @@ -169,7 +169,7 @@ ret = av_get_packet(pb, pkt, size); if (ret != size) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->stream_index = thp->video_stream_index; @@ -177,7 +177,7 @@ ret = av_get_packet(pb, pkt, thp->audiosize); if (ret != thp->audiosize) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->stream_index = thp->audio_stream_index;
--- a/tiertexseq.c Thu Jul 19 15:21:30 2007 +0000 +++ b/tiertexseq.c Thu Jul 19 15:23:32 2007 +0000 @@ -115,7 +115,7 @@ url_fseek(pb, seq->current_frame_offs + data_offs, SEEK_SET); if (get_buffer(pb, seq_buffer->data + seq_buffer->fill_size, data_size) != data_size) - return AVERROR_IO; + return AVERROR(EIO); seq_buffer->fill_size += data_size; return 0; @@ -258,7 +258,7 @@ pkt->data[0] |= 1; url_fseek(pb, seq->current_frame_offs + seq->current_pal_data_offs, SEEK_SET); if (get_buffer(pb, &pkt->data[1], seq->current_pal_data_size) != seq->current_pal_data_size) - return AVERROR_IO; + return AVERROR(EIO); } if (seq->current_video_data_size != 0) { pkt->data[0] |= 2; @@ -277,7 +277,7 @@ /* audio packet */ if (seq->current_audio_data_offs == 0) /* end of data reached */ - return AVERROR_IO; + return AVERROR(EIO); url_fseek(pb, seq->current_frame_offs + seq->current_audio_data_offs, SEEK_SET); rc = av_get_packet(pb, pkt, seq->current_audio_data_size);
--- a/txd.c Thu Jul 19 15:21:30 2007 +0000 +++ b/txd.c Thu Jul 19 15:23:32 2007 +0000 @@ -61,10 +61,10 @@ marker = get_le32(pb); if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); if (marker != TXD_MARKER && marker != TXD_MARKER2) { av_log(NULL, AV_LOG_ERROR, "marker does not match\n"); - return AVERROR_IO; + return AVERROR(EIO); } switch (id) { @@ -78,13 +78,13 @@ goto next_chunk; default: av_log(NULL, AV_LOG_ERROR, "unknown chunk id %i\n", id); - return AVERROR_IO; + return AVERROR(EIO); } ret = av_get_packet(&s->pb, pkt, chunk_size); pkt->stream_index = 0; - return ret <= 0 ? AVERROR_IO : ret; + return ret <= 0 ? AVERROR(EIO) : ret; } static int txd_read_close(AVFormatContext *s) {
--- a/udp.c Thu Jul 19 15:21:30 2007 +0000 +++ b/udp.c Thu Jul 19 15:23:32 2007 +0000 @@ -138,7 +138,7 @@ struct addrinfo *res0; url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port, NULL, 0, uri); res0 = udp_ipv6_resolve_host(hostname, port, SOCK_DGRAM, AF_UNSPEC, 0); - if (res0 == 0) return AVERROR_IO; + if (res0 == 0) return AVERROR(EIO); memcpy(&s->dest_addr, res0->ai_addr, res0->ai_addrlen); s->dest_addr_len = res0->ai_addrlen; freeaddrinfo(res0); @@ -236,7 +236,7 @@ /* set the destination address */ if (resolve_host(&s->dest_addr.sin_addr, hostname) < 0) - return AVERROR_IO; + return AVERROR(EIO); s->dest_addr.sin_family = AF_INET; s->dest_addr.sin_port = htons(port); return 0; @@ -401,7 +401,7 @@ if (udp_fd >= 0) closesocket(udp_fd); av_free(s); - return AVERROR_IO; + return AVERROR(EIO); } static int udp_read(URLContext *h, uint8_t *buf, int size) @@ -422,7 +422,7 @@ if (len < 0) { if (ff_neterrno() != FF_NETERROR(EAGAIN) && ff_neterrno() != FF_NETERROR(EINTR)) - return AVERROR_IO; + return AVERROR(EIO); } else { break; } @@ -446,7 +446,7 @@ if (ret < 0) { if (ff_neterrno() != FF_NETERROR(EINTR) && ff_neterrno() != FF_NETERROR(EAGAIN)) - return AVERROR_IO; + return AVERROR(EIO); } else { break; }
--- a/utils.c Thu Jul 19 15:21:30 2007 +0000 +++ b/utils.c Thu Jul 19 15:23:32 2007 +0000 @@ -449,7 +449,7 @@ url_fclose(pb); if (url_fopen(pb, filename, URL_RDONLY) < 0) { file_opened = 0; - err = AVERROR_IO; + err = AVERROR(EIO); goto fail; } }
--- a/v4l2.c Thu Jul 19 15:21:30 2007 +0000 +++ b/v4l2.c Thu Jul 19 15:23:32 2007 +0000 @@ -443,7 +443,7 @@ input.index = ap->channel; if(ioctl (s->fd, VIDIOC_ENUMINPUT, &input) < 0) { av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl enum input failed:\n"); - return AVERROR_IO; + return AVERROR(EIO); } av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set input_id: %d, input: %s\n", @@ -451,7 +451,7 @@ if(ioctl (s->fd, VIDIOC_S_INPUT, &input.index) < 0 ) { av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set input(%d) failed\n", ap->channel); - return AVERROR_IO; + return AVERROR(EIO); } } @@ -465,7 +465,7 @@ if (ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0) { av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set standard(%s) failed\n", ap->standard); - return AVERROR_IO; + return AVERROR(EIO); } if(!strcasecmp(standard.name, ap->standard)) { @@ -478,7 +478,7 @@ if (ioctl(s->fd, VIDIOC_S_STD, &standard.id) < 0) { av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set standard(%s) failed\n", ap->standard); - return AVERROR_IO; + return AVERROR(EIO); } } @@ -526,7 +526,7 @@ if (s->fd < 0) { av_free(st); - return AVERROR_IO; + return AVERROR(EIO); } av_log(s1, AV_LOG_INFO, "[%d]Capabilities: %x\n", s->fd, capabilities); @@ -553,12 +553,12 @@ close(s->fd); av_free(st); - return AVERROR_IO; + return AVERROR(EIO); } s->frame_format = desired_format; if( v4l2_set_parameters( s1, ap ) < 0 ) - return AVERROR_IO; + return AVERROR(EIO); st->codec->pix_fmt = fmt_v4l2ff(desired_format); s->frame_size = avpicture_get_size(st->codec->pix_fmt, width, height); @@ -576,7 +576,7 @@ close(s->fd); av_free(st); - return AVERROR_IO; + return AVERROR(EIO); } s->top_field_first = first_field(s->fd); @@ -601,14 +601,14 @@ res = mmap_read_frame(s1, pkt); } else if (s->io_method == io_read) { if (av_new_packet(pkt, s->frame_size) < 0) - return AVERROR_IO; + return AVERROR(EIO); res = read_frame(s1, pkt); } else { - return AVERROR_IO; + return AVERROR(EIO); } if (res < 0) { - return AVERROR_IO; + return AVERROR(EIO); } if (s1->streams[0]->codec->coded_frame) {
--- a/vocdec.c Thu Jul 19 15:21:30 2007 +0000 +++ b/vocdec.c Thu Jul 19 15:23:32 2007 +0000 @@ -73,7 +73,7 @@ while (!voc->remaining_size) { type = get_byte(pb); if (type == VOC_TYPE_EOF) - return AVERROR_IO; + return AVERROR(EIO); voc->remaining_size = get_le24(pb); max_size -= 4;
--- a/wav.c Thu Jul 19 15:21:30 2007 +0000 +++ b/wav.c Thu Jul 19 15:23:32 2007 +0000 @@ -200,14 +200,14 @@ WAVContext *wav = s->priv_data; if (url_feof(&s->pb)) - return AVERROR_IO; + return AVERROR(EIO); st = s->streams[0]; left= wav->data_end - url_ftell(&s->pb); if(left <= 0){ left = find_tag(&(s->pb), MKTAG('d', 'a', 't', 'a')); if (left < 0) { - return AVERROR_IO; + return AVERROR(EIO); } wav->data_end= url_ftell(&s->pb) + left; } @@ -221,7 +221,7 @@ size= FFMIN(size, left); ret= av_get_packet(&s->pb, pkt, size); if (ret <= 0) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = 0; /* note: we need to modify the packet size here to handle the last
--- a/wc3movie.c Thu Jul 19 15:21:30 2007 +0000 +++ b/wc3movie.c Thu Jul 19 15:23:32 2007 +0000 @@ -152,7 +152,7 @@ * the first BRCH tag */ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) != WC3_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); fourcc_tag = AV_RL32(&preamble[0]); size = (AV_RB32(&preamble[4]) + 1) & (~1); @@ -169,7 +169,7 @@ /* need the number of palettes */ url_fseek(pb, 8, SEEK_CUR); if ((ret = get_buffer(pb, preamble, 4)) != 4) - return AVERROR_IO; + return AVERROR(EIO); wc3->palette_count = AV_RL32(&preamble[0]); if((unsigned)wc3->palette_count >= UINT_MAX / PALETTE_SIZE){ wc3->palette_count= 0; @@ -185,14 +185,14 @@ else bytes_to_read = 512; if ((ret = get_buffer(pb, s->title, bytes_to_read)) != bytes_to_read) - return AVERROR_IO; + return AVERROR(EIO); break; case SIZE_TAG: /* video resolution override */ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) != WC3_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); wc3->width = AV_RL32(&preamble[0]); wc3->height = AV_RL32(&preamble[4]); break; @@ -204,7 +204,7 @@ if ((ret = get_buffer(pb, &wc3->palettes[current_palette * PALETTE_SIZE], PALETTE_SIZE)) != PALETTE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); /* transform the current palette in place */ for (i = current_palette * PALETTE_SIZE; @@ -228,7 +228,7 @@ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) != WC3_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); fourcc_tag = AV_RL32(&preamble[0]); /* chunk sizes are 16-bit aligned */ size = (AV_RB32(&preamble[4]) + 1) & (~1); @@ -289,7 +289,7 @@ /* get the next chunk preamble */ if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) != WC3_PREAMBLE_SIZE) - ret = AVERROR_IO; + ret = AVERROR(EIO); fourcc_tag = AV_RL32(&preamble[0]); /* chunk sizes are 16-bit aligned */ @@ -304,7 +304,7 @@ case SHOT_TAG: /* load up new palette */ if ((ret = get_buffer(pb, preamble, 4)) != 4) - return AVERROR_IO; + return AVERROR(EIO); palette_number = AV_RL32(&preamble[0]); if (palette_number >= wc3->palette_count) return AVERROR_INVALIDDATA; @@ -324,7 +324,7 @@ pkt->stream_index = wc3->video_stream_index; pkt->pts = wc3->pts; if (ret != size) - ret = AVERROR_IO; + ret = AVERROR(EIO); packet_read = 1; break; @@ -334,7 +334,7 @@ url_fseek(pb, size, SEEK_CUR); #else if ((unsigned)size > sizeof(text) || (ret = get_buffer(pb, text, size)) != size) - ret = AVERROR_IO; + ret = AVERROR(EIO); else { int i = 0; av_log (s, AV_LOG_DEBUG, "Subtitle time!\n"); @@ -353,7 +353,7 @@ pkt->stream_index = wc3->audio_stream_index; pkt->pts = wc3->pts; if (ret != size) - ret = AVERROR_IO; + ret = AVERROR(EIO); /* time to advance pts */ wc3->pts += WC3_FRAME_PTS_INC;
--- a/westwood.c Thu Jul 19 15:21:30 2007 +0000 +++ b/westwood.c Thu Jul 19 15:23:32 2007 +0000 @@ -123,7 +123,7 @@ unsigned char header[AUD_HEADER_SIZE]; if (get_buffer(pb, header, AUD_HEADER_SIZE) != AUD_HEADER_SIZE) - return AVERROR_IO; + return AVERROR(EIO); wsaud->audio_samplerate = AV_RL16(&header[0]); if (header[11] == 99) wsaud->audio_type = CODEC_ID_ADPCM_IMA_WS; @@ -167,7 +167,7 @@ if (get_buffer(pb, preamble, AUD_CHUNK_PREAMBLE_SIZE) != AUD_CHUNK_PREAMBLE_SIZE) - return AVERROR_IO; + return AVERROR(EIO); /* validate the chunk */ if (AV_RL32(&preamble[4]) != AUD_CHUNK_SIGNATURE) @@ -176,7 +176,7 @@ chunk_size = AV_RL16(&preamble[0]); ret= av_get_packet(pb, pkt, chunk_size); if (ret != chunk_size) - return AVERROR_IO; + return AVERROR(EIO); pkt->stream_index = wsaud->audio_stream_index; pkt->pts = wsaud->audio_frame_counter; pkt->pts /= wsaud->audio_samplerate; @@ -240,7 +240,7 @@ if (get_buffer(pb, st->codec->extradata, VQA_HEADER_SIZE) != VQA_HEADER_SIZE) { av_free(st->codec->extradata); - return AVERROR_IO; + return AVERROR(EIO); } st->codec->width = AV_RL16(&header[6]); st->codec->height = AV_RL16(&header[8]); @@ -279,7 +279,7 @@ do { if (get_buffer(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE) { av_free(st->codec->extradata); - return AVERROR_IO; + return AVERROR(EIO); } chunk_tag = AV_RB32(&scratch[0]); chunk_size = AV_RB32(&scratch[4]); @@ -330,11 +330,11 @@ if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) { if (av_new_packet(pkt, chunk_size)) - return AVERROR_IO; + return AVERROR(EIO); ret = get_buffer(pb, pkt->data, chunk_size); if (ret != chunk_size) { av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } if (chunk_type == SND2_TAG) {
--- a/wv.c Thu Jul 19 15:21:30 2007 +0000 +++ b/wv.c Thu Jul 19 15:23:32 2007 +0000 @@ -182,7 +182,7 @@ ret = get_buffer(&s->pb, pkt->data + WV_EXTRA_SIZE, wc->blksize); if(ret != wc->blksize){ av_free_packet(pkt); - return AVERROR_IO; + return AVERROR(EIO); } pkt->stream_index = 0; wc->block_parsed = 1;
--- a/x11grab.c Thu Jul 19 15:21:30 2007 +0000 +++ b/x11grab.c Thu Jul 19 15:23:32 2007 +0000 @@ -80,7 +80,7 @@ * @param ap Parameters from avformat core * @return <ul> * <li>ENOMEM no memory left</li> - * <li>AVERROR_IO other failure case</li> + * <li>AVERROR(EIO) other failure case</li> * <li>0 success</li> * </ul> */ @@ -109,12 +109,12 @@ dpy = XOpenDisplay(param); if(!dpy) { av_log(s1, AV_LOG_ERROR, "Could not open X display.\n"); - return AVERROR_IO; + return AVERROR(EIO); } if (!ap || ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) { av_log(s1, AV_LOG_ERROR, "AVParameters don't have any video size. Use -s.\n"); - return AVERROR_IO; + return AVERROR(EIO); } st = av_new_stream(s1, 0); @@ -148,7 +148,7 @@ if (!XShmAttach(dpy, &x11grab->shminfo)) { av_log(s1, AV_LOG_ERROR, "Fatal: Failed to attach shared memory!\n"); /* needs some better error subroutine :) */ - return AVERROR_IO; + return AVERROR(EIO); } } else { image = XGetImage(dpy, RootWindow(dpy, DefaultScreen(dpy)), @@ -176,7 +176,7 @@ } else { av_log(s1, AV_LOG_ERROR, "RGB ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel); av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask); - return AVERROR_IO; + return AVERROR(EIO); } break; case 24: @@ -191,7 +191,7 @@ } else { av_log(s1, AV_LOG_ERROR,"rgb ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel); av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask); - return AVERROR_IO; + return AVERROR(EIO); } break; case 32: @@ -207,7 +207,7 @@ input_pixfmt = PIX_FMT_ARGB32; } else { av_log(s1, AV_LOG_ERROR,"image depth %i not supported ... aborting\n", image->bits_per_pixel); - return AVERROR_IO; + return AVERROR(EIO); } #endif input_pixfmt = PIX_FMT_RGB32; @@ -459,7 +459,7 @@ } if (av_new_packet(pkt, s->frame_size) < 0) { - return AVERROR_IO; + return AVERROR(EIO); } pkt->pts = curtime;
--- a/yuv4mpeg.c Thu Jul 19 15:21:30 2007 +0000 +++ b/yuv4mpeg.c Thu Jul 19 15:23:32 2007 +0000 @@ -103,7 +103,7 @@ *first_pkt = 0; if (yuv4_generate_header(s, buf2) < 0) { av_log(s, AV_LOG_ERROR, "Error. YUV4MPEG stream header write failed.\n"); - return AVERROR_IO; + return AVERROR(EIO); } else { put_buffer(pb, buf2, strlen(buf2)); } @@ -149,7 +149,7 @@ int* first_pkt = s->priv_data; if (s->nb_streams != 1) - return AVERROR_IO; + return AVERROR(EIO); if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) { av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV stream, some mjpegtools might not work.\n"); @@ -159,7 +159,7 @@ (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) && (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) { av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, yuv422p, yuv420p, yuv411p and gray pixel formats. Use -pix_fmt to select one.\n"); - return AVERROR_IO; + return AVERROR(EIO); } *first_pkt = 1; @@ -361,7 +361,7 @@ return -1; if (av_get_packet(&s->pb, pkt, packet_size) != packet_size) - return AVERROR_IO; + return AVERROR(EIO); if (s->streams[0]->codec->coded_frame) { s->streams[0]->codec->coded_frame->interlaced_frame = s1->interlaced_frame;