diff options
author | François Revol <revol@free.fr> | 2007-02-13 18:26:14 +0000 |
---|---|---|
committer | François Revol <revol@free.fr> | 2007-02-13 18:26:14 +0000 |
commit | 8fa36ae09dddb1b639b4df5d505c0dbcf4e916e4 (patch) | |
tree | 551ead2b59bdc4b1855fb60d6c2ce6a2c7787f15 /libavformat/aviobuf.c | |
parent | bcdf0d269748e2059ffa789033cd6e41739891fc (diff) | |
download | ffmpeg-8fa36ae09dddb1b639b4df5d505c0dbcf4e916e4.tar.gz |
This fixes error handling for BeOS, removing the need for some ifdefs.
AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h.
Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed.
Please from now on use return AVERROR(EFOO) instead of the ugly return -EFOO in your code.
This also removes the need for berrno.h.
Originally committed as revision 7965 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index ca93c64c84..e5aff97aee 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -117,7 +117,7 @@ offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence) offset_t pos= s->pos - (s->write_flag ? 0 : (s->buf_end - s->buffer)); if (whence != SEEK_CUR && whence != SEEK_SET) - return -EINVAL; + return AVERROR(EINVAL); if (whence == SEEK_CUR) { offset1 = pos + (s->buf_ptr - s->buffer); @@ -136,7 +136,7 @@ offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence) fill_buffer(s); s->buf_ptr = s->buf_end + offset - s->pos; } else { - offset_t res = -EPIPE; + offset_t res = AVERROR(EPIPE); #if defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK) if (s->write_flag) { @@ -171,7 +171,7 @@ offset_t url_fsize(ByteIOContext *s) offset_t size; if (!s->seek) - return -EPIPE; + return AVERROR(EPIPE); size = s->seek(s->opaque, 0, AVSEEK_SIZE); if(size<0){ if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0) @@ -511,7 +511,7 @@ int url_fdopen(ByteIOContext *s, URLContext *h) } buffer = av_malloc(buffer_size); if (!buffer) - return -ENOMEM; + return AVERROR(ENOMEM); if (init_put_byte(s, buffer, buffer_size, (h->flags & URL_WRONLY || h->flags & URL_RDWR), h, @@ -530,7 +530,7 @@ int url_setbufsize(ByteIOContext *s, int buf_size) uint8_t *buffer; buffer = av_malloc(buf_size); if (!buffer) - return -ENOMEM; + return AVERROR(ENOMEM); av_free(s->buffer); s->buffer = buffer; |