[FFmpeg-cvslog] r9760 - in trunk: cmdutils.c libavformat/4xm.c libavformat/aiff.c libavformat/amr.c libavformat/apc.c libavformat/asf.c libavformat/au.c libavformat/audio.c libavformat/avio.c libavformat/aviobuf.c libavformat/avisynth.c libavformat/avs.c libavformat/bethsoftvid.c libavformat/c93.c libavformat/daud.c libavformat/dsicin.c libavformat/dv.c libavformat/dv1394.c libavformat/dxa.c libavformat/electronicarts.c libavformat/flic.c libavformat/flvdec.c libavformat/gif.c libavformat/gifdec.c libavformat/grab.c libavformat/gxf.c libavformat/http.c libavformat/idcin.c libavformat/idroq.c libavformat/img2.c libavformat/ipmovie.c libavformat/matroskadec.c libavformat/mm.c libavformat/mmf.c libavformat/mp3.c libavformat/mpc.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mtv.c libavformat/mxf.c libavformat/nuv.c libavformat/ogg.c libavformat/ogg2.c libavformat/psxstr.c libavformat/raw.c libavformat/rmdec.c libavformat/rtp.c libavformat/rtpproto.c libavformat/rtsp.c libavformat/segafilm.c libavformat/sierravmd.c libavformat/smacker.c libavformat/swf.c libavformat/tcp.c libavformat/thp.c libavformat/tiertexseq.c libavformat/txd.c libavformat/udp.c libavformat/utils.c libavformat/v4l2.c libavformat/vocdec.c libavformat/wav.c libavformat/wc3movie.c libavformat/westwood.c libavformat/wv.c libavformat/x11grab.c libavformat/yuv4mpeg.c
takis
subversion
Thu Jul 19 17:23:33 CEST 2007
Author: takis
Date: Thu Jul 19 17:23:32 2007
New Revision: 9760
Log:
Replace all occurrances of AVERROR_IO with AVERROR(EIO).
Modified:
trunk/cmdutils.c
trunk/libavformat/4xm.c
trunk/libavformat/aiff.c
trunk/libavformat/amr.c
trunk/libavformat/apc.c
trunk/libavformat/asf.c
trunk/libavformat/au.c
trunk/libavformat/audio.c
trunk/libavformat/avio.c
trunk/libavformat/aviobuf.c
trunk/libavformat/avisynth.c
trunk/libavformat/avs.c
trunk/libavformat/bethsoftvid.c
trunk/libavformat/c93.c
trunk/libavformat/daud.c
trunk/libavformat/dsicin.c
trunk/libavformat/dv.c
trunk/libavformat/dv1394.c
trunk/libavformat/dxa.c
trunk/libavformat/electronicarts.c
trunk/libavformat/flic.c
trunk/libavformat/flvdec.c
trunk/libavformat/gif.c
trunk/libavformat/gifdec.c
trunk/libavformat/grab.c
trunk/libavformat/gxf.c
trunk/libavformat/http.c
trunk/libavformat/idcin.c
trunk/libavformat/idroq.c
trunk/libavformat/img2.c
trunk/libavformat/ipmovie.c
trunk/libavformat/matroskadec.c
trunk/libavformat/mm.c
trunk/libavformat/mmf.c
trunk/libavformat/mp3.c
trunk/libavformat/mpc.c
trunk/libavformat/mpeg.c
trunk/libavformat/mpegts.c
trunk/libavformat/mtv.c
trunk/libavformat/mxf.c
trunk/libavformat/nuv.c
trunk/libavformat/ogg.c
trunk/libavformat/ogg2.c
trunk/libavformat/psxstr.c
trunk/libavformat/raw.c
trunk/libavformat/rmdec.c
trunk/libavformat/rtp.c
trunk/libavformat/rtpproto.c
trunk/libavformat/rtsp.c
trunk/libavformat/segafilm.c
trunk/libavformat/sierravmd.c
trunk/libavformat/smacker.c
trunk/libavformat/swf.c
trunk/libavformat/tcp.c
trunk/libavformat/thp.c
trunk/libavformat/tiertexseq.c
trunk/libavformat/txd.c
trunk/libavformat/udp.c
trunk/libavformat/utils.c
trunk/libavformat/v4l2.c
trunk/libavformat/vocdec.c
trunk/libavformat/wav.c
trunk/libavformat/wc3movie.c
trunk/libavformat/westwood.c
trunk/libavformat/wv.c
trunk/libavformat/x11grab.c
trunk/libavformat/yuv4mpeg.c
Modified: trunk/cmdutils.c
==============================================================================
--- trunk/cmdutils.c (original)
+++ trunk/cmdutils.c Thu Jul 19 17:23:32 2007
@@ -133,7 +133,7 @@ void print_error(const char *filename, i
case AVERROR_NOFMT:
fprintf(stderr, "%s: Unknown format\n", filename);
break;
- case AVERROR_IO:
+ case AVERROR(EIO):
fprintf(stderr, "%s: I/O error occured\n"
"Usually that means that input file is truncated and/or corrupted.\n",
filename);
Modified: trunk/libavformat/4xm.c
==============================================================================
--- trunk/libavformat/4xm.c (original)
+++ trunk/libavformat/4xm.c Thu Jul 19 17:23:32 2007
@@ -118,7 +118,7 @@ static int fourxm_read_header(AVFormatCo
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 @@ static int fourxm_read_packet(AVFormatCo
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 @@ static int fourxm_read_packet(AVFormatCo
/* 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 @@ static int fourxm_read_packet(AVFormatCo
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;
Modified: trunk/libavformat/aiff.c
==============================================================================
--- trunk/libavformat/aiff.c (original)
+++ trunk/libavformat/aiff.c Thu Jul 19 17:23:32 2007
@@ -64,7 +64,7 @@ static int get_tag(ByteIOContext *pb, ui
int size;
if (url_feof(pb))
- return AVERROR_IO;
+ return AVERROR(EIO);
*tag = get_le32(pb);
size = get_be32(pb);
@@ -400,7 +400,7 @@ static int aiff_read_packet(AVFormatCont
/* 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);
Modified: trunk/libavformat/amr.c
==============================================================================
--- trunk/libavformat/amr.c (original)
+++ trunk/libavformat/amr.c Thu Jul 19 17:23:32 2007
@@ -122,7 +122,7 @@ static int amr_read_packet(AVFormatConte
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 @@ static int amr_read_packet(AVFormatConte
if ( (size==0) || av_new_packet(pkt, size))
{
- return AVERROR_IO;
+ return AVERROR(EIO);
}
pkt->stream_index = 0;
@@ -160,7 +160,7 @@ static int amr_read_packet(AVFormatConte
if (read != size-1)
{
av_free_packet(pkt);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
return 0;
Modified: trunk/libavformat/apc.c
==============================================================================
--- trunk/libavformat/apc.c (original)
+++ trunk/libavformat/apc.c Thu Jul 19 17:23:32 2007
@@ -75,7 +75,7 @@ static int apc_read_header(AVFormatConte
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;
}
Modified: trunk/libavformat/asf.c
==============================================================================
--- trunk/libavformat/asf.c (original)
+++ trunk/libavformat/asf.c Thu Jul 19 17:23:32 2007
@@ -714,7 +714,7 @@ static int asf_read_packet(AVFormatConte
//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 @@ static int asf_read_packet(AVFormatConte
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)
Modified: trunk/libavformat/au.c
==============================================================================
--- trunk/libavformat/au.c (original)
+++ trunk/libavformat/au.c Thu Jul 19 17:23:32 2007
@@ -159,10 +159,10 @@ static int au_read_packet(AVFormatContex
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
Modified: trunk/libavformat/audio.c
==============================================================================
--- trunk/libavformat/audio.c (original)
+++ trunk/libavformat/audio.c Thu Jul 19 17:23:32 2007
@@ -59,7 +59,7 @@ static int audio_open(AudioData *s, int
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
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
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(AVFormatCo
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(AVFormatCo
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(AVFormatCon
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(AVFormatCon
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(AVFormatCon
}
if (!(ret == 0 || (ret == -1 && (errno == EAGAIN || errno == EINTR)))) {
av_free_packet(pkt);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
}
pkt->size = ret;
Modified: trunk/libavformat/avio.c
==============================================================================
--- trunk/libavformat/avio.c (original)
+++ trunk/libavformat/avio.c Thu Jul 19 17:23:32 2007
@@ -101,7 +101,7 @@ int url_read(URLContext *h, unsigned cha
{
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 url_write(URLContext *h, unsigned ch
{
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;
}
Modified: trunk/libavformat/aviobuf.c
==============================================================================
--- trunk/libavformat/aviobuf.c (original)
+++ trunk/libavformat/aviobuf.c Thu Jul 19 17:23:32 2007
@@ -514,7 +514,7 @@ int url_fdopen(ByteIOContext *s, URLCont
(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;
Modified: trunk/libavformat/avisynth.c
==============================================================================
--- trunk/libavformat/avisynth.c (original)
+++ trunk/libavformat/avisynth.c Thu Jul 19 17:23:32 2007
@@ -156,10 +156,10 @@ static int avisynth_read_packet(AVFormat
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;
Modified: trunk/libavformat/avs.c
==============================================================================
--- trunk/libavformat/avs.c (original)
+++ trunk/libavformat/avs.c Thu Jul 19 17:23:32 2007
@@ -106,7 +106,7 @@ avs_read_video_packet(AVFormatContext *
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 @@ static int avs_read_audio_packet(AVForma
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 @@ static int avs_read_packet(AVFormatConte
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 @@ static int avs_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/bethsoftvid.c
==============================================================================
--- trunk/libavformat/bethsoftvid.c (original)
+++ trunk/libavformat/bethsoftvid.c Thu Jul 19 17:23:32 2007
@@ -179,7 +179,7 @@ static int vid_read_packet(AVFormatConte
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 @@ static int vid_read_packet(AVFormatConte
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 @@ static int vid_read_packet(AVFormatConte
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 @@ static int vid_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/c93.c
==============================================================================
--- trunk/libavformat/c93.c (original)
+++ trunk/libavformat/c93.c Thu Jul 19 17:23:32 2007
@@ -129,7 +129,7 @@ static int read_packet(AVFormatContext *
}
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 @@ static int read_packet(AVFormatContext *
ret = get_buffer(pb, pkt->data + 1, datasize);
if (ret < datasize) {
- ret = AVERROR_IO;
+ ret = AVERROR(EIO);
goto fail;
}
@@ -168,7 +168,7 @@ static int read_packet(AVFormatContext *
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;
Modified: trunk/libavformat/daud.c
==============================================================================
--- trunk/libavformat/daud.c (original)
+++ trunk/libavformat/daud.c Thu Jul 19 17:23:32 2007
@@ -37,7 +37,7 @@ static int daud_packet(AVFormatContext *
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);
Modified: trunk/libavformat/dsicin.c
==============================================================================
--- trunk/libavformat/dsicin.c (original)
+++ trunk/libavformat/dsicin.c Thu Jul 19 17:23:32 2007
@@ -147,7 +147,7 @@ static int cin_read_frame_header(CinDemu
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 @@ static int cin_read_packet(AVFormatConte
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 @@ static int cin_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/dv.c
==============================================================================
--- trunk/libavformat/dv.c (original)
+++ trunk/libavformat/dv.c Thu Jul 19 17:23:32 2007
@@ -388,7 +388,7 @@ static int dv_read_header(AVFormatContex
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 @@ static int dv_read_packet(AVFormatContex
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);
}
Modified: trunk/libavformat/dv1394.c
==============================================================================
--- trunk/libavformat/dv1394.c (original)
+++ trunk/libavformat/dv1394.c Thu Jul 19 17:23:32 2007
@@ -124,7 +124,7 @@ static int dv1394_read_header(AVFormatCo
failed:
close(dv->fd);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
static int dv1394_read_packet(AVFormatContext *context, AVPacket *pkt)
@@ -163,12 +163,12 @@ restart_poll:
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"
Modified: trunk/libavformat/dxa.c
==============================================================================
--- trunk/libavformat/dxa.c (original)
+++ trunk/libavformat/dxa.c Thu Jul 19 17:23:32 2007
@@ -149,7 +149,7 @@ static int dxa_read_packet(AVFormatConte
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 @@ static int dxa_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/electronicarts.c
==============================================================================
--- trunk/libavformat/electronicarts.c (original)
+++ trunk/libavformat/electronicarts.c Thu Jul 19 17:23:32 2007
@@ -178,7 +178,7 @@ static int ea_read_header(AVFormatContex
AVStream *st;
if (!process_ea_header(s))
- return AVERROR_IO;
+ return AVERROR(EIO);
#if 0
/* initialize the video decoder stream */
@@ -226,7 +226,7 @@ static int ea_read_packet(AVFormatContex
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 @@ static int ea_read_packet(AVFormatContex
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 @@ static int ea_read_packet(AVFormatContex
/* ending tag */
case SCEl_TAG:
- ret = AVERROR_IO;
+ ret = AVERROR(EIO);
packet_read = 1;
break;
Modified: trunk/libavformat/flic.c
==============================================================================
--- trunk/libavformat/flic.c (original)
+++ trunk/libavformat/flic.c Thu Jul 19 17:23:32 2007
@@ -78,7 +78,7 @@ static int flic_read_header(AVFormatCont
/* 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 @@ static int flic_read_packet(AVFormatCont
if ((ret = get_buffer(pb, preamble, FLIC_PREAMBLE_SIZE)) !=
FLIC_PREAMBLE_SIZE) {
- ret = AVERROR_IO;
+ ret = AVERROR(EIO);
break;
}
@@ -178,7 +178,7 @@ static int flic_read_packet(AVFormatCont
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 @@ static int flic_read_packet(AVFormatCont
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;
Modified: trunk/libavformat/flvdec.c
==============================================================================
--- trunk/libavformat/flvdec.c (original)
+++ trunk/libavformat/flvdec.c Thu Jul 19 17:23:32 2007
@@ -270,7 +270,7 @@ static int flv_read_packet(AVFormatConte
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 @@ static int flv_read_packet(AVFormatConte
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 */
Modified: trunk/libavformat/gif.c
==============================================================================
--- trunk/libavformat/gif.c (original)
+++ trunk/libavformat/gif.c Thu Jul 19 17:23:32 2007
@@ -343,7 +343,7 @@ static int gif_write_header(AVFormatCont
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);
Modified: trunk/libavformat/gifdec.c
==============================================================================
--- trunk/libavformat/gifdec.c (original)
+++ trunk/libavformat/gifdec.c Thu Jul 19 17:23:32 2007
@@ -500,21 +500,21 @@ static int gif_parse_next_image(GifState
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 @@ static int gif_read_packet(AVFormatConte
/* 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);
Modified: trunk/libavformat/grab.c
==============================================================================
--- trunk/libavformat/grab.c (original)
+++ trunk/libavformat/grab.c Thu Jul 19 17:23:32 2007
@@ -279,7 +279,7 @@ static int grab_read_header(AVFormatCont
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 @@ static int v4l_mm_read_picture(VideoData
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 @@ static int grab_read_packet(AVFormatCont
}
if (av_new_packet(pkt, s->frame_size) < 0)
- return AVERROR_IO;
+ return AVERROR(EIO);
pkt->pts = curtime;
@@ -345,7 +345,7 @@ static int grab_read_packet(AVFormatCont
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;
}
}
Modified: trunk/libavformat/gxf.c
==============================================================================
--- trunk/libavformat/gxf.c (original)
+++ trunk/libavformat/gxf.c Thu Jul 19 17:23:32 2007
@@ -473,7 +473,7 @@ static int gxf_packet(AVFormatContext *s
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) {
Modified: trunk/libavformat/http.c
==============================================================================
--- trunk/libavformat/http.c (original)
+++ trunk/libavformat/http.c Thu Jul 19 17:23:32 2007
@@ -101,7 +101,7 @@ static int http_open_cnx(URLContext *h)
/* 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 @@ static int http_open_cnx(URLContext *h)
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 @@ static int http_getc(HTTPContext *s)
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 @@ static int http_connect(URLContext *h, c
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 @@ static int http_connect(URLContext *h, c
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')
Modified: trunk/libavformat/idcin.c
==============================================================================
--- trunk/libavformat/idcin.c (original)
+++ trunk/libavformat/idcin.c Thu Jul 19 17:23:32 2007
@@ -165,7 +165,7 @@ static int idcin_read_header(AVFormatCon
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 @@ static int idcin_read_packet(AVFormatCon
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 @@ static int idcin_read_packet(AVFormatCon
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 @@ static int idcin_read_packet(AVFormatCon
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;
Modified: trunk/libavformat/idroq.c
==============================================================================
--- trunk/libavformat/idroq.c (original)
+++ trunk/libavformat/idroq.c Thu Jul 19 17:23:32 2007
@@ -79,7 +79,7 @@ static int roq_read_header(AVFormatConte
/* 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 @@ static int roq_read_header(AVFormatConte
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 @@ static int roq_read_header(AVFormatConte
/* 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 @@ static int roq_read_packet(AVFormatConte
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 @@ static int roq_read_packet(AVFormatConte
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 @@ static int roq_read_packet(AVFormatConte
/* 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 @@ static int roq_read_packet(AVFormatConte
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 @@ static int roq_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/img2.c
==============================================================================
--- trunk/libavformat/img2.c (original)
+++ trunk/libavformat/img2.c Thu Jul 19 17:23:32 2007
@@ -208,7 +208,7 @@ static int img_read_header(AVFormatConte
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 @@ static int img_read_packet(AVFormatConte
}
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 @@ static int img_read_packet(AVFormatConte
} else {
f[0] = &s1->pb;
if (url_feof(f[0]))
- return AVERROR_IO;
+ return AVERROR(EIO);
size[0]= 4096;
}
@@ -286,7 +286,7 @@ static int img_read_packet(AVFormatConte
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 @@ static int img_write_packet(AVFormatCont
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;
Modified: trunk/libavformat/ipmovie.c
==============================================================================
--- trunk/libavformat/ipmovie.c (original)
+++ trunk/libavformat/ipmovie.c Thu Jul 19 17:23:32 2007
@@ -539,7 +539,7 @@ static int ipmovie_read_header(AVFormatC
* 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 @@ static int ipmovie_read_packet(AVFormatC
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)
Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c (original)
+++ trunk/libavformat/matroskadec.c Thu Jul 19 17:23:32 2007
@@ -223,7 +223,7 @@ ebml_read_num (MatroskaDemuxContext *mat
"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 @@ ebml_read_ascii (MatroskaDemuxContext *m
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 @@ ebml_read_binary (MatroskaDemuxContext *
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 @@ ebml_read_header (MatroskaDemuxContext *
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 @@ matroska_parse_info (MatroskaDemuxContex
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 @@ matroska_add_stream (MatroskaDemuxContex
/* 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 @@ matroska_add_stream (MatroskaDemuxContex
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 @@ matroska_add_stream (MatroskaDemuxContex
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 @@ matroska_parse_tracks (MatroskaDemuxCont
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 @@ matroska_parse_index (MatroskaDemuxConte
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 @@ matroska_parse_index (MatroskaDemuxConte
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 @@ matroska_parse_index (MatroskaDemuxConte
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 @@ matroska_parse_metadata (MatroskaDemuxCo
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 @@ matroska_parse_seekhead (MatroskaDemuxCo
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 @@ matroska_parse_seekhead (MatroskaDemuxCo
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 @@ matroska_read_header (AVFormatContext
/* 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 @@ matroska_read_header (AVFormatContext
/* 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 @@ matroska_parse_blockgroup (MatroskaDemux
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 @@ matroska_parse_cluster (MatroskaDemuxCon
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 @@ matroska_read_packet (AVFormatContext *s
/* 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;
Modified: trunk/libavformat/mm.c
==============================================================================
--- trunk/libavformat/mm.c (original)
+++ trunk/libavformat/mm.c Thu Jul 19 17:23:32 2007
@@ -136,7 +136,7 @@ static int mm_read_packet(AVFormatContex
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 @@ static int mm_read_packet(AVFormatContex
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 @@ static int mm_read_packet(AVFormatContex
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++;
Modified: trunk/libavformat/mmf.c
==============================================================================
--- trunk/libavformat/mmf.c (original)
+++ trunk/libavformat/mmf.c Thu Jul 19 17:23:32 2007
@@ -266,7 +266,7 @@ static int mmf_read_packet(AVFormatConte
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 @@ static int mmf_read_packet(AVFormatConte
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);
Modified: trunk/libavformat/mp3.c
==============================================================================
--- trunk/libavformat/mp3.c (original)
+++ trunk/libavformat/mp3.c Thu Jul 19 17:23:32 2007
@@ -485,7 +485,7 @@ static int mp3_read_packet(AVFormatConte
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 */
Modified: trunk/libavformat/mpc.c
==============================================================================
--- trunk/libavformat/mpc.c (original)
+++ trunk/libavformat/mpc.c Thu Jul 19 17:23:32 2007
@@ -148,7 +148,7 @@ static int mpc_read_packet(AVFormatConte
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 @@ static int mpc_read_packet(AVFormatConte
url_fseek(&s->pb, -4, SEEK_CUR);
if(ret < size){
av_free_packet(pkt);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
pkt->size = ret + 4;
Modified: trunk/libavformat/mpeg.c
==============================================================================
--- trunk/libavformat/mpeg.c (original)
+++ trunk/libavformat/mpeg.c Thu Jul 19 17:23:32 2007
@@ -232,7 +232,7 @@ static int mpegps_read_pes_header(AVForm
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)
Modified: trunk/libavformat/mpegts.c
==============================================================================
--- trunk/libavformat/mpegts.c (original)
+++ trunk/libavformat/mpegts.c Thu Jul 19 17:23:32 2007
@@ -1014,7 +1014,7 @@ static int read_packet(ByteIOContext *pb
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 */
Modified: trunk/libavformat/mtv.c
==============================================================================
--- trunk/libavformat/mtv.c (original)
+++ trunk/libavformat/mtv.c Thu Jul 19 17:23:32 2007
@@ -122,7 +122,7 @@ static int mtv_read_header(AVFormatConte
/* 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 @@ static int mtv_read_packet(AVFormatConte
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 @@ static int mtv_read_packet(AVFormatConte
{
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
Modified: trunk/libavformat/mxf.c
==============================================================================
--- trunk/libavformat/mxf.c (original)
+++ trunk/libavformat/mxf.c Thu Jul 19 17:23:32 2007
@@ -361,7 +361,7 @@ static int mxf_read_packet(AVFormatConte
} else
url_fskip(&s->pb, klv.length);
}
- return AVERROR_IO;
+ return AVERROR(EIO);
}
static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set)
Modified: trunk/libavformat/nuv.c
==============================================================================
--- trunk/libavformat/nuv.c (original)
+++ trunk/libavformat/nuv.c Thu Jul 19 17:23:32 2007
@@ -225,7 +225,7 @@ static int nuv_packet(AVFormatContext *s
break;
}
}
- return AVERROR_IO;
+ return AVERROR(EIO);
}
AVInputFormat nuv_demuxer = {
Modified: trunk/libavformat/ogg.c
==============================================================================
--- trunk/libavformat/ogg.c (original)
+++ trunk/libavformat/ogg.c Thu Jul 19 17:23:32 2007
@@ -205,7 +205,7 @@ static int ogg_read_header(AVFormatConte
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 @@ static int ogg_read_packet(AVFormatConte
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)
Modified: trunk/libavformat/ogg2.c
==============================================================================
--- trunk/libavformat/ogg2.c (original)
+++ trunk/libavformat/ogg2.c Thu Jul 19 17:23:32 2007
@@ -540,7 +540,7 @@ ogg_read_packet (AVFormatContext * s, AV
//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 @@ ogg_read_packet (AVFormatContext * s, AV
//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){
Modified: trunk/libavformat/psxstr.c
==============================================================================
--- trunk/libavformat/psxstr.c (original)
+++ trunk/libavformat/psxstr.c Thu Jul 19 17:23:32 2007
@@ -142,7 +142,7 @@ static int str_read_header(AVFormatConte
/* 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 @@ static int str_read_header(AVFormatConte
/* 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 @@ static int str_read_packet(AVFormatConte
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 @@ static int str_read_packet(AVFormatConte
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 @@ printf (" dropping audio sector\n");
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 @@ printf (" dropping other sector\n");
}
if (url_feof(pb))
- return AVERROR_IO;
+ return AVERROR(EIO);
}
return ret;
Modified: trunk/libavformat/raw.c
==============================================================================
--- trunk/libavformat/raw.c (original)
+++ trunk/libavformat/raw.c Thu Jul 19 17:23:32 2007
@@ -115,7 +115,7 @@ static int raw_read_packet(AVFormatConte
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 @@ static int raw_read_partial_packet(AVFor
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 @@ static int ingenient_read_packet(AVForma
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 @@ static int ingenient_read_packet(AVForma
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 @@ static int rawvideo_read_packet(AVFormat
pkt->stream_index = 0;
if (ret != packet_size) {
- return AVERROR_IO;
+ return AVERROR(EIO);
} else {
return 0;
}
Modified: trunk/libavformat/rmdec.c
==============================================================================
--- trunk/libavformat/rmdec.c (original)
+++ trunk/libavformat/rmdec.c Thu Jul 19 17:23:32 2007
@@ -220,7 +220,7 @@ static int rm_read_header(AVFormatContex
/* 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 @@ skip:
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 @@ static int rm_read_packet(AVFormatContex
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 @@ static int rm_read_packet(AVFormatContex
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 @@ static int rm_read_packet(AVFormatContex
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) {
Modified: trunk/libavformat/rtp.c
==============================================================================
--- trunk/libavformat/rtp.c (original)
+++ trunk/libavformat/rtp.c Thu Jul 19 17:23:32 2007
@@ -741,7 +741,7 @@ static int rtp_write_header(AVFormatCont
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) {
Modified: trunk/libavformat/rtpproto.c
==============================================================================
--- trunk/libavformat/rtpproto.c (original)
+++ trunk/libavformat/rtpproto.c Thu Jul 19 17:23:32 2007
@@ -163,7 +163,7 @@ static int rtp_open(URLContext *h, const
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 @@ static int rtp_read(URLContext *h, uint8
if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
ff_neterrno() == FF_NETERROR(EINTR))
continue;
- return AVERROR_IO;
+ return AVERROR(EIO);
}
break;
}
@@ -206,7 +206,7 @@ static int rtp_read(URLContext *h, uint8
if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
ff_neterrno() == FF_NETERROR(EINTR))
continue;
- return AVERROR_IO;
+ return AVERROR(EIO);
}
break;
}
@@ -219,7 +219,7 @@ static int rtp_read(URLContext *h, uint8
if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
ff_neterrno() == FF_NETERROR(EINTR))
continue;
- return AVERROR_IO;
+ return AVERROR(EIO);
}
break;
}
Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c (original)
+++ trunk/libavformat/rtsp.c Thu Jul 19 17:23:32 2007
@@ -886,7 +886,7 @@ static int rtsp_read_header(AVFormatCont
/* 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 @@ static int rtsp_read_packet(AVFormatCont
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 @@ int redir_open(AVFormatContext **ic_ptr,
}
*ic_ptr = ic;
if (!ic)
- return AVERROR_IO;
+ return AVERROR(EIO);
else
return 0;
}
Modified: trunk/libavformat/segafilm.c
==============================================================================
--- trunk/libavformat/segafilm.c (original)
+++ trunk/libavformat/segafilm.c Thu Jul 19 17:23:32 2007
@@ -89,7 +89,7 @@ static int film_read_header(AVFormatCont
/* 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 @@ static int film_read_header(AVFormatCont
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 @@ static int film_read_header(AVFormatCont
} 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 @@ static int film_read_header(AVFormatCont
/* 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 @@ static int film_read_header(AVFormatCont
/* 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 @@ static int film_read_packet(AVFormatCont
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 @@ static int film_read_packet(AVFormatCont
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 @@ static int film_read_packet(AVFormatCont
} 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;
Modified: trunk/libavformat/sierravmd.c
==============================================================================
--- trunk/libavformat/sierravmd.c (original)
+++ trunk/libavformat/sierravmd.c Thu Jul 19 17:23:32 2007
@@ -89,7 +89,7 @@ static int vmd_read_header(AVFormatConte
/* 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 @@ static int vmd_read_header(AVFormatConte
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 @@ static int vmd_read_packet(AVFormatConte
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 @@ static int vmd_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/smacker.c
==============================================================================
--- trunk/libavformat/smacker.c (original)
+++ trunk/libavformat/smacker.c Thu Jul 19 17:23:32 2007
@@ -199,7 +199,7 @@ static int smacker_read_header(AVFormatC
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 @@ static int smacker_read_packet(AVFormatC
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 @@ static int smacker_read_packet(AVFormatC
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++;
Modified: trunk/libavformat/swf.c
==============================================================================
--- trunk/libavformat/swf.c (original)
+++ trunk/libavformat/swf.c Thu Jul 19 17:23:32 2007
@@ -639,10 +639,10 @@ static int swf_read_header(AVFormatConte
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 @@ static int swf_read_header(AVFormatConte
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 @@ static int swf_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/tcp.c
==============================================================================
--- trunk/libavformat/tcp.c (original)
+++ trunk/libavformat/tcp.c Thu Jul 19 17:23:32 2007
@@ -98,7 +98,7 @@ static int tcp_open(URLContext *h, const
return 0;
fail:
- ret = AVERROR_IO;
+ ret = AVERROR(EIO);
fail1:
if (fd >= 0)
closesocket(fd);
Modified: trunk/libavformat/thp.c
==============================================================================
--- trunk/libavformat/thp.c (original)
+++ trunk/libavformat/thp.c Thu Jul 19 17:23:32 2007
@@ -148,7 +148,7 @@ static int thp_read_packet(AVFormatConte
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 @@ static int thp_read_packet(AVFormatConte
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 @@ static int thp_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/tiertexseq.c
==============================================================================
--- trunk/libavformat/tiertexseq.c (original)
+++ trunk/libavformat/tiertexseq.c Thu Jul 19 17:23:32 2007
@@ -115,7 +115,7 @@ static int seq_fill_buffer(SeqDemuxConte
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 @@ static int seq_read_packet(AVFormatConte
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 @@ static int seq_read_packet(AVFormatConte
/* 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);
Modified: trunk/libavformat/txd.c
==============================================================================
--- trunk/libavformat/txd.c (original)
+++ trunk/libavformat/txd.c Thu Jul 19 17:23:32 2007
@@ -61,10 +61,10 @@ next_chunk:
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 @@ next_chunk:
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) {
Modified: trunk/libavformat/udp.c
==============================================================================
--- trunk/libavformat/udp.c (original)
+++ trunk/libavformat/udp.c Thu Jul 19 17:23:32 2007
@@ -138,7 +138,7 @@ static int udp_ipv6_set_remote_url(URLCo
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 @@ int udp_set_remote_url(URLContext *h, co
/* 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 @@ static int udp_open(URLContext *h, const
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 @@ static int udp_read(URLContext *h, uint8
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 @@ static int udp_write(URLContext *h, uint
if (ret < 0) {
if (ff_neterrno() != FF_NETERROR(EINTR) &&
ff_neterrno() != FF_NETERROR(EAGAIN))
- return AVERROR_IO;
+ return AVERROR(EIO);
} else {
break;
}
Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c (original)
+++ trunk/libavformat/utils.c Thu Jul 19 17:23:32 2007
@@ -449,7 +449,7 @@ int av_open_input_file(AVFormatContext *
url_fclose(pb);
if (url_fopen(pb, filename, URL_RDONLY) < 0) {
file_opened = 0;
- err = AVERROR_IO;
+ err = AVERROR(EIO);
goto fail;
}
}
Modified: trunk/libavformat/v4l2.c
==============================================================================
--- trunk/libavformat/v4l2.c (original)
+++ trunk/libavformat/v4l2.c Thu Jul 19 17:23:32 2007
@@ -443,7 +443,7 @@ static int v4l2_set_parameters( AVFormat
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 @@ static int v4l2_set_parameters( AVFormat
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 @@ static int v4l2_set_parameters( AVFormat
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 @@ static int v4l2_set_parameters( AVFormat
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 @@ static int v4l2_read_header(AVFormatCont
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 @@ static int v4l2_read_header(AVFormatCont
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 @@ static int v4l2_read_header(AVFormatCont
close(s->fd);
av_free(st);
- return AVERROR_IO;
+ return AVERROR(EIO);
}
s->top_field_first = first_field(s->fd);
@@ -601,14 +601,14 @@ static int v4l2_read_packet(AVFormatCont
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) {
Modified: trunk/libavformat/vocdec.c
==============================================================================
--- trunk/libavformat/vocdec.c (original)
+++ trunk/libavformat/vocdec.c Thu Jul 19 17:23:32 2007
@@ -73,7 +73,7 @@ voc_get_packet(AVFormatContext *s, AVPac
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;
Modified: trunk/libavformat/wav.c
==============================================================================
--- trunk/libavformat/wav.c (original)
+++ trunk/libavformat/wav.c Thu Jul 19 17:23:32 2007
@@ -200,14 +200,14 @@ static int wav_read_packet(AVFormatConte
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 @@ static int wav_read_packet(AVFormatConte
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
Modified: trunk/libavformat/wc3movie.c
==============================================================================
--- trunk/libavformat/wc3movie.c (original)
+++ trunk/libavformat/wc3movie.c Thu Jul 19 17:23:32 2007
@@ -152,7 +152,7 @@ static int wc3_read_header(AVFormatConte
* 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 @@ static int wc3_read_header(AVFormatConte
/* 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 @@ static int wc3_read_header(AVFormatConte
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 @@ static int wc3_read_header(AVFormatConte
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 @@ static int wc3_read_header(AVFormatConte
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 @@ static int wc3_read_packet(AVFormatConte
/* 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 @@ static int wc3_read_packet(AVFormatConte
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 @@ static int wc3_read_packet(AVFormatConte
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 @@ static int wc3_read_packet(AVFormatConte
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 @@ static int wc3_read_packet(AVFormatConte
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;
Modified: trunk/libavformat/westwood.c
==============================================================================
--- trunk/libavformat/westwood.c (original)
+++ trunk/libavformat/westwood.c Thu Jul 19 17:23:32 2007
@@ -123,7 +123,7 @@ static int wsaud_read_header(AVFormatCon
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 @@ static int wsaud_read_packet(AVFormatCon
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 @@ static int wsaud_read_packet(AVFormatCon
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 @@ static int wsvqa_read_header(AVFormatCon
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 @@ static int wsvqa_read_header(AVFormatCon
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 @@ static int wsvqa_read_packet(AVFormatCon
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) {
Modified: trunk/libavformat/wv.c
==============================================================================
--- trunk/libavformat/wv.c (original)
+++ trunk/libavformat/wv.c Thu Jul 19 17:23:32 2007
@@ -182,7 +182,7 @@ static int wv_read_packet(AVFormatContex
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;
Modified: trunk/libavformat/x11grab.c
==============================================================================
--- trunk/libavformat/x11grab.c (original)
+++ trunk/libavformat/x11grab.c Thu Jul 19 17:23:32 2007
@@ -80,7 +80,7 @@ typedef struct x11_grab_s
* @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 @@ x11grab_read_header(AVFormatContext *s1,
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 @@ x11grab_read_header(AVFormatContext *s1,
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 @@ x11grab_read_header(AVFormatContext *s1,
} 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 @@ x11grab_read_header(AVFormatContext *s1,
} 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 @@ x11grab_read_header(AVFormatContext *s1,
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 @@ x11grab_read_packet(AVFormatContext *s1,
}
if (av_new_packet(pkt, s->frame_size) < 0) {
- return AVERROR_IO;
+ return AVERROR(EIO);
}
pkt->pts = curtime;
Modified: trunk/libavformat/yuv4mpeg.c
==============================================================================
--- trunk/libavformat/yuv4mpeg.c (original)
+++ trunk/libavformat/yuv4mpeg.c Thu Jul 19 17:23:32 2007
@@ -103,7 +103,7 @@ static int yuv4_write_packet(AVFormatCon
*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 @@ static int yuv4_write_header(AVFormatCon
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 @@ static int yuv4_write_header(AVFormatCon
(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 @@ static int yuv4_read_packet(AVFormatCont
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;
More information about the ffmpeg-cvslog
mailing list