Avoid a generic function for specialized behavior

This commit is contained in:
Chris Robinson 2019-06-29 11:45:55 -07:00
parent 6790a9b44f
commit b905a224ee

View File

@ -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); }
/************************************************