GNOME Bugzilla – Bug 756948
directsoundsrc - Audio Device not found on Windows (string encoding not honored)
Last modified: 2016-05-04 07:22:44 UTC
The 'device-name' property for audio device selection does not honor the encoding. The pipeline string is in utf8 and the device name from windows is in the local code page encoded. So before comparing, we need to convert the device-name to local 8 bit stringliteral. The bug was introduced here: https://bugzilla.gnome.org/show_bug.cgi?id=706574 Problematic code section: ```cpp if (pGUID && dsoundsrc && dsoundsrc->device_name && !g_strcmp0 (dsoundsrc->device_name, strDesc)) ```
Can you confirm that using g_locale_from_utf8() fixes it?
Zack? Did you have a chance to try if that fixes it?
Created attachment 327134 [details] [review] directsoundsrc: Convert Windows strings to UTF8 before comparing against UTF8 strings The device name and descriptions returned are in the locale encoding, not UTF8. Our device name property is in UTF8 though, so we need to convert.
Review of attachment 327134 [details] [review]: ::: sys/directsound/gstdirectsoundsrc.c @@ +353,2 @@ if (pGUID && dsoundsrc && dsoundsrc->device_name && !g_strcmp0 (dsoundsrc->device_name, strDesc)) { This should use description instead of strDesc, but g_locale_to_utf8() is failing here anyway so there must be something else going on here.
Created attachment 327225 [details] [review] directsoundsrc: Convert Windows strings to UTF8 before comparing against UTF8 strings The device name and descriptions returned are in the locale encoding, not UTF8. Our device name property is in UTF8 though, so we need to convert.
Attachment 327225 [details] pushed as 65398a1 - directsoundsrc: Convert Windows strings to UTF8 before comparing against UTF8 strings