diff options
author | Chris Robinson <[email protected]> | 2018-11-15 04:24:33 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-15 04:24:33 -0800 |
commit | 1971d0f5c6c94b250f4b3e29bdfa95c836f900bc (patch) | |
tree | b3af8bbd22fe26ad4db683214911897fae767ae3 /Alc/backends/pulseaudio.cpp | |
parent | d4f64b9e29319f56f2ecab1291918a52ec8336f1 (diff) |
Use std::string instead of al_string for enumerating
Diffstat (limited to 'Alc/backends/pulseaudio.cpp')
-rw-r--r-- | Alc/backends/pulseaudio.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp index 09b55229..37aee77c 100644 --- a/Alc/backends/pulseaudio.cpp +++ b/Alc/backends/pulseaudio.cpp @@ -1741,7 +1741,7 @@ struct PulseBackendFactory final : public ALCbackendFactory { static ALCboolean PulseBackendFactory_init(PulseBackendFactory *self); static void PulseBackendFactory_deinit(PulseBackendFactory *self); static ALCboolean PulseBackendFactory_querySupport(PulseBackendFactory *self, ALCbackend_Type type); -static void PulseBackendFactory_probe(PulseBackendFactory *self, enum DevProbe type, al_string *outnames); +static void PulseBackendFactory_probe(PulseBackendFactory *self, enum DevProbe type, std::string *outnames); static ALCbackend* PulseBackendFactory_createBackend(PulseBackendFactory *self, ALCdevice *device, ALCbackend_Type type); DEFINE_ALCBACKENDFACTORY_VTABLE(PulseBackendFactory); @@ -1810,16 +1810,14 @@ static ALCboolean PulseBackendFactory_querySupport(PulseBackendFactory* UNUSED(s return ALC_FALSE; } -static void PulseBackendFactory_probe(PulseBackendFactory* UNUSED(self), enum DevProbe type, al_string *outnames) +static void PulseBackendFactory_probe(PulseBackendFactory* UNUSED(self), enum DevProbe type, std::string *outnames) { 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); }; switch(type) { |