aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/wasapi.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-15 04:24:33 -0800
committerChris Robinson <[email protected]>2018-11-15 04:24:33 -0800
commit1971d0f5c6c94b250f4b3e29bdfa95c836f900bc (patch)
treeb3af8bbd22fe26ad4db683214911897fae767ae3 /Alc/backends/wasapi.cpp
parentd4f64b9e29319f56f2ecab1291918a52ec8336f1 (diff)
Use std::string instead of al_string for enumerating
Diffstat (limited to 'Alc/backends/wasapi.cpp')
-rw-r--r--Alc/backends/wasapi.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp
index 22edc09f..b55187ab 100644
--- a/Alc/backends/wasapi.cpp
+++ b/Alc/backends/wasapi.cpp
@@ -1824,7 +1824,7 @@ struct ALCwasapiBackendFactory final : public ALCbackendFactory {
static ALCboolean ALCwasapiBackendFactory_init(ALCwasapiBackendFactory *self);
static void ALCwasapiBackendFactory_deinit(ALCwasapiBackendFactory *self);
static ALCboolean ALCwasapiBackendFactory_querySupport(ALCwasapiBackendFactory *self, ALCbackend_Type type);
-static void ALCwasapiBackendFactory_probe(ALCwasapiBackendFactory *self, enum DevProbe type, al_string *outnames);
+static void ALCwasapiBackendFactory_probe(ALCwasapiBackendFactory *self, enum DevProbe type, std::string *outnames);
static ALCbackend* ALCwasapiBackendFactory_createBackend(ALCwasapiBackendFactory *self, ALCdevice *device, ALCbackend_Type type);
DEFINE_ALCBACKENDFACTORY_VTABLE(ALCwasapiBackendFactory);
@@ -1880,7 +1880,7 @@ static ALCboolean ALCwasapiBackendFactory_querySupport(ALCwasapiBackendFactory*
return ALC_FALSE;
}
-static void ALCwasapiBackendFactory_probe(ALCwasapiBackendFactory* UNUSED(self), enum DevProbe type, al_string *outnames)
+static void ALCwasapiBackendFactory_probe(ALCwasapiBackendFactory* UNUSED(self), enum DevProbe type, std::string *outnames)
{
ThreadRequest req{ nullptr, 0 };
@@ -1891,12 +1891,10 @@ static void ALCwasapiBackendFactory_probe(ALCwasapiBackendFactory* UNUSED(self),
{
auto add_device = [outnames](const DevMap &entry) -> void
{
- const char *name{entry.name.c_str()};
- size_t namelen{entry.name.length()};
/* +1 to also append the null char (to ensure a null-separated list
* and double-null terminated list).
*/
- alstr_append_range(outnames, name, name + namelen+1);
+ outnames->append(entry.name.c_str(), entry.name.length()+1);
};
HRESULT hr = E_FAIL;
if(PostThreadMessage(ThreadID, WM_USER_Enumerate, (WPARAM)&req, type))