[FFmpeg-cvslog] r22887 - in trunk/libavformat: network.h rtsp.c

rbultje subversion
Thu Apr 15 20:27:28 CEST 2010


Author: rbultje
Date: Thu Apr 15 20:27:27 2010
New Revision: 22887

Log:
Fix compile error on cygwin where ETIME is missing (because it's a WSA error).
This patch also changes FF_NETERROR() to be an AVERROR(), i.e. it is always
negative, whereas it was previously positive.

Modified:
   trunk/libavformat/network.h
   trunk/libavformat/rtsp.c

Modified: trunk/libavformat/network.h
==============================================================================
--- trunk/libavformat/network.h	Thu Apr 15 15:30:12 2010	(r22886)
+++ trunk/libavformat/network.h	Thu Apr 15 20:27:27 2010	(r22887)
@@ -27,8 +27,8 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
-#define ff_neterrno() WSAGetLastError()
-#define FF_NETERROR(err) WSA##err
+#define ff_neterrno() (-WSAGetLastError())
+#define FF_NETERROR(err) (-WSA##err)
 #define WSAEAGAIN WSAEWOULDBLOCK
 #else
 #include <sys/types.h>
@@ -36,8 +36,8 @@
 #include <netinet/in.h>
 #include <netdb.h>
 
-#define ff_neterrno() errno
-#define FF_NETERROR(err) err
+#define ff_neterrno() AVERROR(errno)
+#define FF_NETERROR(err) AVERROR(err)
 #endif
 
 #if HAVE_ARPA_INET_H

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	Thu Apr 15 15:30:12 2010	(r22886)
+++ trunk/libavformat/rtsp.c	Thu Apr 15 20:27:27 2010	(r22887)
@@ -1692,7 +1692,7 @@ static int udp_read_packet(AVFormatConte
             }
 #endif
         } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
-            return AVERROR(ETIMEDOUT);
+            return FF_NETERROR(ETIMEDOUT);
         } else if (n < 0 && errno != EINTR)
             return AVERROR(errno);
     }



More information about the ffmpeg-cvslog mailing list