diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-05-20 17:05:36 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-05-20 17:05:36 +0000 |
| commit | 8ecf3a1af7dafafd412f0af265c18c0516e56f7c (patch) | |
| tree | e72f2f816f21fe144066b27a463e3dc7fc4dd512 /src/plugins/Output/wasapi | |
| parent | 5206f4a8dd20f624065ef854c77fe3d37e6c03a5 (diff) | |
| download | qmmp-8ecf3a1af7dafafd412f0af265c18c0516e56f7c.tar.gz qmmp-8ecf3a1af7dafafd412f0af265c18c0516e56f7c.tar.bz2 qmmp-8ecf3a1af7dafafd412f0af265c18c0516e56f7c.zip | |
wasapi output: enabled audio converter
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6371 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Output/wasapi')
| -rw-r--r-- | src/plugins/Output/wasapi/outputwasapi.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/Output/wasapi/outputwasapi.cpp b/src/plugins/Output/wasapi/outputwasapi.cpp index 2585240bd..3b985429a 100644 --- a/src/plugins/Output/wasapi/outputwasapi.cpp +++ b/src/plugins/Output/wasapi/outputwasapi.cpp @@ -36,6 +36,10 @@ const IID IID_ISimpleAudioVolume = __uuidof(ISimpleAudioVolume); #define WASAPI_BUFSIZE 20000000LL //2s
+#ifndef AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM
+#define AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM 0x80000000
+#endif
+
OutputWASAPI *OutputWASAPI::instance = 0;
VolumeWASAPI *OutputWASAPI::volumeControl = 0;
OutputWASAPI::DWASAPIChannels OutputWASAPI::m_wasapi_pos[10] = {
@@ -139,7 +143,15 @@ bool OutputWASAPI::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat fo wfex.dwChannelMask = mask;
wfex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
- if((result = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,0, 20000000LL, 0, (WAVEFORMATEX *)&wfex, NULL)) != S_OK)
+ DWORD streamFlags = 0;
+ //enable channel matrixer and a sample rate converter if format is unsupported
+ if(m_pAudioClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX *)&wfex, 0) != S_OK)
+ {
+ streamFlags |= AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM;
+ qDebug("OutputWASAPI: format is not supported, using converter");
+ }
+
+ if((result = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, streamFlags, 20000000LL, 0, (WAVEFORMATEX *)&wfex, NULL)) != S_OK)
{
qWarning("OutputWASAPI: IAudioClient::Initialize failed, error code = 0x%lx", result);
return false;
|
