diff options
author | antoine <antoine@FreeBSD.org> | 2013-06-13 03:05:12 +0800 |
---|---|---|
committer | antoine <antoine@FreeBSD.org> | 2013-06-13 03:05:12 +0800 |
commit | 0d7f6de0d2cec4c774de90a312e8602f2f4a7221 (patch) | |
tree | 4e636e8f1b34cbbd203002ca8283211902912810 /multimedia | |
parent | 32b087464c0275dac1fd4abdbf74793f2b586bee (diff) | |
download | freebsd-ports-gnome-0d7f6de0d2cec4c774de90a312e8602f2f4a7221.tar.gz freebsd-ports-gnome-0d7f6de0d2cec4c774de90a312e8602f2f4a7221.tar.zst freebsd-ports-gnome-0d7f6de0d2cec4c774de90a312e8602f2f4a7221.zip |
Update adapter detection patch to report correct IDs
PR: ports/179517
Submitted by: Mickael Maillot
Approved by: Manuel Creach (maintainer)
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/libcec/Makefile | 1 | ||||
-rw-r--r-- | multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp | 25 |
2 files changed, 18 insertions, 8 deletions
diff --git a/multimedia/libcec/Makefile b/multimedia/libcec/Makefile index 60cf3e8fc556..7d0f873f31a0 100644 --- a/multimedia/libcec/Makefile +++ b/multimedia/libcec/Makefile @@ -3,6 +3,7 @@ PORTNAME= libcec PORTVERSION= 2.1.3 +PORTREVISION= 1 CATEGORIES= multimedia MASTER_SITES= GH diff --git a/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp b/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp index dd8829f8f7a3..7e2d53e224d5 100644 --- a/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp +++ b/multimedia/libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp @@ -1,5 +1,5 @@ ---- ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp.orig 2013-05-13 13:09:14.000000000 +0000 -+++ ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp 2013-06-08 12:30:51.000000000 +0000 +--- ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp.orig 2013-05-13 15:09:14.000000000 +0200 ++++ ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp 2013-06-12 16:31:03.000000000 +0200 @@ -61,6 +61,8 @@ #include <libudev.h> } @@ -9,7 +9,7 @@ #include <stdio.h> #include <unistd.h> #endif -@@ -434,22 +436,68 @@ +@@ -434,22 +436,77 @@ } #elif defined(__FreeBSD__) char devicePath[PATH_MAX + 1]; @@ -25,13 +25,15 @@ { - (void)snprintf(devicePath, sizeof(devicePath), "/dev/ttyU%d", i); - if (strDevicePath && strcmp(devicePath, strDevicePath) != 0) ++ unsigned int iVendor, iProduct; + memset(infos, 0, sizeof(infos)); + (void)snprintf(sysctlname, sizeof(sysctlname), + "dev.umodem.%d.%%pnpinfo", i); + if (sysctlbyname(sysctlname, infos, &infos_size, + NULL, 0) != 0) + break; -+ if (strstr(infos, "vendor=0x2548") == NULL) ++ pos = strstr(infos, "vendor="); ++ if (pos == NULL) continue; - if (!access(devicePath, 0)) - { @@ -41,9 +43,16 @@ - deviceList[iFound].iProductId = CEC_VID; - deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type - iFound++; -+ if (strstr(infos, "product=0x1001") == NULL -+ && strstr(infos, "product=0x1002") == NULL) ++ sscanf(pos, "vendor=%x ", &iVendor); ++ ++ pos = strstr(infos, "product="); ++ if (pos == NULL) + continue; ++ sscanf(pos, "product=%x ", &iProduct); ++ ++ if (iVendor != CEC_VID || (iProduct != CEC_PID && iProduct != CEC_PID2)) ++ continue; ++ + pos = strstr(infos, "ttyname="); + if (pos == NULL) + continue; @@ -82,8 +91,8 @@ } + snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath); + snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath); -+ deviceList[iFound].iVendorId = CEC_VID; -+ deviceList[iFound].iProductId = CEC_VID; ++ deviceList[iFound].iVendorId = iVendor; ++ deviceList[iFound].iProductId = iProduct; + deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type + iFound++; } |