• R/O
  • HTTP
  • SSH
  • HTTPS

timidity41: Commit


Commit MetaInfo

Revisión429ba69ea4a9e77cc7dad569eee685f443842003 (tree)
Tiempo2018-06-06 02:13:36
AutorStarg <starg@user...>
CommiterStarg

Log Message

Support compilers without AUDCLNT_STREAMOPTIONS_AMBISONICS

Cambiar Resumen

Diferencia incremental

--- a/timidity/wasapi_a.c
+++ b/timidity/wasapi_a.c
@@ -137,6 +137,14 @@ const IID tim_IID_IAudioClient = {0x1CB9AD4C, 0xDBFA, 0x4C32, {0xB1, 0
137137 const IID tim_IID_IAudioRenderClient = {0xF294ACFC, 0x3146, 0x4483, {0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2}};
138138 const IID tim_IID_IAudioClient2 = {0x726778CD, 0xF60A, 0x4EDA, {0x82, 0xDE, 0xE4, 0x76, 0x10, 0xCD, 0x78, 0xAA}};
139139
140+// Some compilers do not have the latest version of AudioClientProperties
141+typedef struct {
142+ UINT32 cbSize;
143+ BOOL bIsOffload;
144+ INT /* AUDIO_STREAM_CATEGORY */ eCategory;
145+ INT /* AUDCLNT_STREAMOPTIONS */ Options;
146+} timAudioClientProperties;
147+
140148 #define SPEAKER_FRONT_LEFT 0x1
141149 #define SPEAKER_FRONT_RIGHT 0x2
142150 #define SPEAKER_FRONT_CENTER 0x4
@@ -927,25 +935,24 @@ int open_output(void)
927935
928936 if (SUCCEEDED(IAudioClient_QueryInterface(pAudioClient, &tim_IID_IAudioClient2, (void**)&pAudioClient2)))
929937 {
930- AudioClientProperties acp = {0};
931- acp.cbSize = min(sizeof(AudioClientProperties), ver >= 4 ? 16 : 12);
938+ timAudioClientProperties acp = {0};
939+ acp.cbSize = (ver >= 4 ? 16 : 12);
932940 acp.bIsOffload = FALSE;
933941 acp.eCategory = opt_wasapi_stream_category;
934942
935-#if (NTDDI_VERSION >= NTDDI_WINBLUE) && !defined(__MINGW32__)
936943 if (opt_wasapi_stream_option & 4) {
937944 if (ver >= 6) // win10以上
938- acp.Options |= AUDCLNT_STREAMOPTIONS_AMBISONICS;
945+ acp.Options |= 4 /* AUDCLNT_STREAMOPTIONS_AMBISONICS */;
939946 }
940947 if (opt_wasapi_stream_option & 2) {
941948 if (ver >= 6) // win10以上
942- acp.Options |= AUDCLNT_STREAMOPTIONS_MATCH_FORMAT;
949+ acp.Options |= 2 /* AUDCLNT_STREAMOPTIONS_MATCH_FORMAT */;
943950 }
944951 if (opt_wasapi_stream_option & 1){
945952 if(ver >= 4) // win8.1以上
946- acp.Options |= AUDCLNT_STREAMOPTIONS_RAW;
953+ acp.Options |= 1 /* AUDCLNT_STREAMOPTIONS_RAW */;
947954 }
948-#endif
955+
949956 hr = IAudioClient2_SetClientProperties(pAudioClient2, &acp);
950957 IAudioClient2_Release(pAudioClient2);
951958 if (FAILED(hr))
Show on old repository browser