mac下obs插件mac-capture在获取音频设备名称转char*时,因出现中文到时转换失败,从而音频设备列表为空。如果系统改成英文版就可以。
可以修改mac-capture下的mac-helpers.h的cf_to_dstr借口
static inline bool cf_to_dstr(CFStringRef ref, struct dstr *str)
{
size_t size;
if (!ref) return false;
CFIndex length = CFStringGetLength(ref);
size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
//原来获取的大小方式
//size = (size_t)CFStringGetLength(ref);
if (!size)
return false;
dstr_resize(str, size);
return (bool)CFStringGetCString(ref, str->array, size+1,
kCFStringEncodingUTF8);
}