diff options
author | Chris Robinson <[email protected]> | 2019-06-29 11:45:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-29 11:45:55 -0700 |
commit | b905a224eece5e6679498fddf46d93874b2fb4af (patch) | |
tree | 0a106f219d6e7100af4c4aac909c1d5561f1d050 | |
parent | 6790a9b44fd79f430b683cbd7761d174c530b82e (diff) |
Avoid a generic function for specialized behavior
-rw-r--r-- | Alc/alc.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 3a083048..60c7e790 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -1176,21 +1176,24 @@ static void alc_initconfig(void) /************************************************ * Device enumeration ************************************************/ -static void ProbeDevices(std::string *list, DevProbe type) +static void ProbeAllDevicesList() { DO_INITCONFIG(); std::lock_guard<std::recursive_mutex> _{ListLock}; - list->clear(); - if(type == DevProbe::Playback && PlaybackFactory) - PlaybackFactory->probe(type, list); - else if(type == DevProbe::Capture && CaptureFactory) - CaptureFactory->probe(type, list); + alcAllDevicesList.clear(); + if(PlaybackFactory) + PlaybackFactory->probe(DevProbe::Playback, &alcAllDevicesList); +} +static void ProbeCaptureDeviceList() +{ + DO_INITCONFIG(); + + std::lock_guard<std::recursive_mutex> _{ListLock}; + alcCaptureDeviceList.clear(); + if(CaptureFactory) + CaptureFactory->probe(DevProbe::Capture, &alcCaptureDeviceList); } -static void ProbeAllDevicesList(void) -{ ProbeDevices(&alcAllDevicesList, DevProbe::Playback); } -static void ProbeCaptureDeviceList(void) -{ ProbeDevices(&alcCaptureDeviceList, DevProbe::Capture); } /************************************************ |