summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorFrançois Revol <revol@free.fr>2007-02-13 18:26:14 +0000
committerFrançois Revol <revol@free.fr>2007-02-13 18:26:14 +0000
commit8fa36ae09dddb1b639b4df5d505c0dbcf4e916e4 (patch)
tree551ead2b59bdc4b1855fb60d6c2ce6a2c7787f15 /libavformat/utils.c
parentbcdf0d269748e2059ffa789033cd6e41739891fc (diff)
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/utils.c')
-rw-r--r--libavformat/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 30a082720e..cabe3a7704 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -478,7 +478,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
/* read probe data */
pd->buf= av_realloc(pd->buf, probe_size);
pd->buf_size = get_buffer(pb, pd->buf, probe_size);
- if (url_fseek(pb, 0, SEEK_SET) == (offset_t)-EPIPE) {
+ if (url_fseek(pb, 0, SEEK_SET) == (offset_t)AVERROR(EPIPE)) {
url_fclose(pb);
if (url_fopen(pb, filename, URL_RDONLY) < 0) {
file_opened = 0;
@@ -805,7 +805,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
/* read next packet */
ret = av_read_packet(s, &s->cur_pkt);
if (ret < 0) {
- if (ret == -EAGAIN)
+ if (ret == AVERROR(EAGAIN))
return ret;
/* return the last frames, if any */
for(i = 0; i < s->nb_streams; i++) {
@@ -916,7 +916,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
AVPacketList **plast_pktl= &s->packet_buffer;
int ret= av_read_frame_internal(s, pkt);
if(ret<0){
- if(pktl && ret != -EAGAIN){
+ if(pktl && ret != AVERROR(EAGAIN)){
eof=1;
continue;
}else