diff options
Diffstat (limited to '3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c')
-rw-r--r-- | 3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c b/3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c index 4bd067acf9a..05403e5c2ca 100644 --- a/3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c +++ b/3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c @@ -25,13 +25,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -39,14 +39,14 @@ #include <mmreg.h> #ifndef WAVE_FORMAT_IEEE_FLOAT #define WAVE_FORMAT_IEEE_FLOAT 0x0003 // MinGW32 does not define this -#endif +#endif #ifndef _WAVEFORMATEXTENSIBLE_ #define _WAVEFORMATEXTENSIBLE_ // MinGW32 does not define this #endif #ifndef _INC_MMREG #define _INC_MMREG // for STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT #endif -#include <winioctl.h> // MinGW32 does not define this automatically +#include <winioctl.h> // MinGW32 does not define this automatically #if defined(__GNUC__) @@ -145,7 +145,7 @@ static PaError WdmGetPinPropertyMulti( return paUnanticipatedHostError; } - *ksMultipleItem = (KSMULTIPLE_ITEM*)PaUtil_AllocateMemory( multipleItemSize ); + *ksMultipleItem = (KSMULTIPLE_ITEM*)PaUtil_AllocateZeroInitializedMemory( multipleItemSize ); if( !*ksMultipleItem ) { return paInsufficientMemory; @@ -198,7 +198,7 @@ static KSPIN_DATAFLOW GetKSFilterPinPropertyDataflow( HANDLE deviceHandle, int p } -static int KSFilterPinPropertyIdentifiersInclude( +static int KSFilterPinPropertyIdentifiersInclude( HANDLE deviceHandle, int pinId, unsigned long property, const GUID *identifierSet, unsigned long identifierId ) { KSMULTIPLE_ITEM* item = NULL; @@ -208,13 +208,13 @@ static int KSFilterPinPropertyIdentifiersInclude( if( WdmGetPinPropertyMulti( deviceHandle, pinId, property, &item) != paNoError ) return 0; - + identifier = (KSIDENTIFIER*)(item+1); for( i = 0; i < (int)item->Count; i++ ) { if( !memcmp( (void*)&identifier[i].Set, (void*)identifierSet, sizeof( GUID ) ) && - ( identifier[i].Id == identifierId ) ) + ( identifier[i].Id == identifierId ) ) { result = 1; break; @@ -227,17 +227,17 @@ static int KSFilterPinPropertyIdentifiersInclude( } -/* return the maximum channel count supported by any pin on the device. +/* return the maximum channel count supported by any pin on the device. if isInput is non-zero we query input pins, otherwise output pins. */ int PaWin_WDMKS_QueryFilterMaximumChannelCount( void *wcharDevicePath, int isInput ) { HANDLE deviceHandle; - ULONG i; + ULONG i; int pinCount, pinId; int result = 0; KSPIN_DATAFLOW requiredDataflowDirection = (isInput ? KSPIN_DATAFLOW_OUT : KSPIN_DATAFLOW_IN ); - + if( !wcharDevicePath ) return 0; @@ -252,14 +252,14 @@ int PaWin_WDMKS_QueryFilterMaximumChannelCount( void *wcharDevicePath, int isInp KSPIN_DATAFLOW dataflow = GetKSFilterPinPropertyDataflow( deviceHandle, pinId ); if( ( dataflow == requiredDataflowDirection ) && (( communication == KSPIN_COMMUNICATION_SINK) || - ( communication == KSPIN_COMMUNICATION_BOTH)) - && ( KSFilterPinPropertyIdentifiersInclude( deviceHandle, pinId, + ( communication == KSPIN_COMMUNICATION_BOTH)) + && ( KSFilterPinPropertyIdentifiersInclude( deviceHandle, pinId, KSPROPERTY_PIN_INTERFACES, &pa_KSINTERFACESETID_Standard, KSINTERFACE_STANDARD_STREAMING ) - || KSFilterPinPropertyIdentifiersInclude( deviceHandle, pinId, + || KSFilterPinPropertyIdentifiersInclude( deviceHandle, pinId, KSPROPERTY_PIN_INTERFACES, &pa_KSINTERFACESETID_Standard, KSINTERFACE_STANDARD_LOOPED_STREAMING ) ) - && KSFilterPinPropertyIdentifiersInclude( deviceHandle, pinId, + && KSFilterPinPropertyIdentifiersInclude( deviceHandle, pinId, KSPROPERTY_PIN_MEDIUMS, &pa_KSMEDIUMSETID_Standard, KSMEDIUM_STANDARD_DEVIO ) ) - { + { KSMULTIPLE_ITEM* item = NULL; if( WdmGetPinPropertyMulti( deviceHandle, pinId, KSPROPERTY_PIN_DATARANGES, &item ) == paNoError ) { @@ -274,10 +274,10 @@ int PaWin_WDMKS_QueryFilterMaximumChannelCount( void *wcharDevicePath, int isInp && ( memcmp( (void*)&dataRange->SubFormat, (void*)&KSDATAFORMAT_SUBTYPE_WILDCARD, sizeof(GUID) ) == 0 ) ) ) { KSDATARANGE_AUDIO *dataRangeAudio = (KSDATARANGE_AUDIO*)dataRange; - + /* printf( ">>> %d %d %d %d %S\n", isInput, dataflow, communication, dataRangeAudio->MaximumChannels, devicePath ); - + if( memcmp((void*)&dataRange->Specifier, (void*)&KSDATAFORMAT_SPECIFIER_WAVEFORMATEX, sizeof(GUID) ) == 0 ) printf( "\tspecifier: KSDATAFORMAT_SPECIFIER_WAVEFORMATEX\n" ); else if( memcmp((void*)&dataRange->Specifier, (void*)&KSDATAFORMAT_SPECIFIER_DSOUND, sizeof(GUID) ) == 0 ) @@ -295,7 +295,7 @@ int PaWin_WDMKS_QueryFilterMaximumChannelCount( void *wcharDevicePath, int isInp if( dataRangeAudio->MaximumChannels < 0xFFFFUL && (int)dataRangeAudio->MaximumChannels > result ) result = (int)dataRangeAudio->MaximumChannels; } - + dataRange = (KSDATARANGE*)( ((char*)dataRange) + dataRange->FormatSize); } @@ -303,7 +303,7 @@ int PaWin_WDMKS_QueryFilterMaximumChannelCount( void *wcharDevicePath, int isInp } } } - + CloseHandle( deviceHandle ); return result; } |