[PATCH v2] devenum: Fix device and friendly name for video capture devices.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH v2] devenum: Fix device and friendly name for video capture devices.

Zebediah Figura
Signed-off-by: Zebediah Figura <[hidden email]>
---
 dlls/devenum/createdevenum.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c
index 2db5491190..269a19e23f 100644
--- a/dlls/devenum/createdevenum.c
+++ b/dlls/devenum/createdevenum.c
@@ -774,9 +774,9 @@ static void register_vfw_codecs(void)
 static void register_avicap_devices(void)
 {
     static const WCHAR vfwindexW[] = {'V','F','W','I','n','d','e','x',0};
-    WCHAR friendlyname[] = {'v','i','d','e','o','0',0};
+    WCHAR name[] = {'v','i','d','e','o','0',0};
+    WCHAR friendlyname[32], version[32];
     IPropertyBag *prop_bag = NULL;
-    WCHAR name[32], version[32];
     REGFILTERPINS2 rgpins = {0};
     REGPINTYPES rgtypes;
     REGFILTER2 rgf;
@@ -790,10 +790,11 @@ static void register_avicap_devices(void)
 
     for (i = 0; i < 10; ++i)
     {
-        if (!capGetDriverDescriptionW(i, name, ARRAY_SIZE(name), version, ARRAY_SIZE(version)))
+        if (!capGetDriverDescriptionW(i, friendlyname, ARRAY_SIZE(friendlyname),
+                version, ARRAY_SIZE(version)))
             break;
 
-        friendlyname[5] = '0' + i;
+        name[5] = '0' + i;
 
         hr = register_codec(&CLSID_VideoInputDeviceCategory, name,
                 &CLSID_VfwCapture, friendlyname, &prop_bag);
--
2.21.0