From: Ross Bencina Date: Sun, 11 Sep 2016 13:05:26 +0000 (+1000) Subject: hotplug wmme: only pull default device settings from environment once, at X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=0448f3e7b7c79fb153030adc9531801d4ef09811;p=portaudio hotplug wmme: only pull default device settings from environment once, at initialization time. it is designed to operate on the active device list, so it was a bug to call it from ScanDeviceInfos anyhow. --- diff --git a/src/hostapi/wmme/pa_win_wmme.c b/src/hostapi/wmme/pa_win_wmme.c index 76085e9..66645f2 100644 --- a/src/hostapi/wmme/pa_win_wmme.c +++ b/src/hostapi/wmme/pa_win_wmme.c @@ -1058,6 +1058,8 @@ PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd /* Ignore the result of CommitDeviceInfos(), it is a non-failing operation */ CommitDeviceInfos( &winMmeHostApi->inheritedHostApiRep, hostApiIndex, scanResults, deviceCount ); + InitializeDefaultDeviceIdsFromEnv( winMmeHostApi ); /* uses the active device list. must be called after CommitDeviceInfos */ + (*hostApi)->Terminate = Terminate; (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; @@ -1617,8 +1619,6 @@ static PaError ScanDeviceInfos( struct PaUtilHostApiRepresentation *hostApi, PaH } } - InitializeDefaultDeviceIdsFromEnv( winMmeHostApi ); - *scanResults = outArgument; return result;