Mercurial > libavformat.hg
diff ffm.c @ 1787:eb16c64144ee libavformat
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.
| author | mmu_man |
|---|---|
| date | Tue, 13 Feb 2007 18:26:14 +0000 |
| parents | 65b7b3ff4ed7 |
| children | 491581a2b9a7 |
line wrap: on
line diff
--- a/ffm.c Tue Feb 13 08:21:47 2007 +0000 +++ b/ffm.c Tue Feb 13 18:26:14 2007 +0000 @@ -579,7 +579,7 @@ switch(ffm->read_state) { case READ_HEADER: if (!ffm_is_avail_data(s, FRAME_HEADER_SIZE)) { - return -EAGAIN; + return AVERROR(EAGAIN); } #if 0 printf("pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n", @@ -587,7 +587,7 @@ #endif if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) != FRAME_HEADER_SIZE) - return -EAGAIN; + return AVERROR(EAGAIN); #if 0 { int i; @@ -601,7 +601,7 @@ case READ_DATA: size = (ffm->header[2] << 16) | (ffm->header[3] << 8) | ffm->header[4]; if (!ffm_is_avail_data(s, size)) { - return -EAGAIN; + return AVERROR(EAGAIN); } duration = (ffm->header[5] << 16) | (ffm->header[6] << 8) | ffm->header[7]; @@ -616,7 +616,7 @@ if (ffm_read_data(s, pkt->data, size, 0) != size) { /* bad case: desynchronized packet. we cancel all the packet loading */ av_free_packet(pkt); - return -EAGAIN; + return AVERROR(EAGAIN); } if (ffm->first_frame_in_packet) {
