diff avio.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 2649c0a9c037
children 84ed710a9adc
line wrap: on
line diff
--- a/avio.c	Tue Feb 13 08:21:47 2007 +0000
+++ b/avio.c	Tue Feb 13 18:26:14 2007 +0000
@@ -67,12 +67,12 @@
             goto found;
         up = up->next;
     }
-    err = -ENOENT;
+    err = AVERROR(ENOENT);
     goto fail;
  found:
     uc = av_malloc(sizeof(URLContext) + strlen(filename) + 1);
     if (!uc) {
-        err = -ENOMEM;
+        err = AVERROR(ENOMEM);
         goto fail;
     }
 #if LIBAVFORMAT_VERSION_INT >= (52<<16)
@@ -124,7 +124,7 @@
     offset_t ret;
 
     if (!h->prot->url_seek)
-        return -EPIPE;
+        return AVERROR(EPIPE);
     ret = h->prot->url_seek(h, pos, whence);
     return ret;
 }
@@ -188,8 +188,8 @@
 
 /**
  * The callback is called in blocking functions to test regulary if
- * asynchronous interruption is needed. -EINTR is returned in this
- * case by the interrupted function. 'NULL' means no interrupt
+ * asynchronous interruption is needed. AVERROR(EINTR) is returned
+ * in this case by the interrupted function. 'NULL' means no interrupt
  * callback is given.
  */
 void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)