avicap32: Use define instead of hardcoded value (try 2)

André Hentschel nerv at dawncrow.de
Wed Feb 23 12:08:04 CST 2011


---
 dlls/avicap32/avicap32_main.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c
index 349ee5d..19caf78 100644
--- a/dlls/avicap32/avicap32_main.c
+++ b/dlls/avicap32/avicap32_main.c
@@ -55,6 +55,9 @@
 #include "wine/debug.h"
 
 #define CAP_DESC_MAX 32
+#ifndef ENOIOCTLCMD
+# define ENOIOCTLCMD 515
+#endif
 
 WINE_DEFAULT_DEBUG_CHANNEL(avicap);
 
@@ -142,15 +145,14 @@ static BOOL query_video_device(int devnum, char *name, int namesize, char *versi
       return TRUE;
    }
 
-   if (errno != EINVAL && errno != 515)
+   if (errno != EINVAL && errno != ENOIOCTLCMD)
       WARN("%s: ioctl failed: %s -- Falling back to V4L\n", device, strerror(errno));
    else WARN("%s: Not a V4L2 compatible device, trying V4l 1\n", device);
 #endif /* HAVE_V4L2 */
 
    memset(&capa, 0, sizeof(capa));
    if (xioctl(fd, VIDIOCGCAP, &capa) == -1) {
-/* errno 515 is used by some webcam drivers for unknown IOICTL command */
-      if (errno != EINVAL && errno != 515)
+      if (errno != EINVAL && errno != ENOIOCTLCMD)
          ERR("%s: Querying failed: %s\n", device, strerror(errno));
       else ERR("%s: Querying failed: Not a V4L compatible device\n", device);
       close(fd);
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list