Commit 1b103e12 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

cppcx: Remove MMdeviceLocator hack

parent 52cc4c94
......@@ -25,7 +25,6 @@
#include <collection.h>
//HACK HACK HACK
#include "MMDeviceLocator.h"
using namespace Windows::Graphics::Display;
namespace libVLCX
......@@ -33,7 +32,7 @@ namespace libVLCX
Instance::Instance(Windows::Foundation::Collections::IVector<Platform::String^>^ argv, SwapChainPanel^ panel)
: m_chainPanel(panel)
{
int extraArgs = 4;
int extraArgs = 3;
auto c_argv = new char*[argv->Size + extraArgs];
unsigned int i = 0;
for (auto arg : argv)
......@@ -58,27 +57,6 @@ namespace libVLCX
m_dxManager->CreateSwapPanel(m_chainPanel);
UpdateSize(m_chainPanel->ActualWidth, m_chainPanel->ActualHeight);
ComPtr<MMDeviceLocator> audioReg = Make<MMDeviceLocator>();
audioReg->m_AudioClient = NULL;
audioReg->m_audioClientReady = CreateEventEx(NULL, TEXT("AudioClientReady"), 0, EVENT_ALL_ACCESS);
audioReg->RegisterForWASAPI();
void *addr = NULL;
DWORD res;
while ((res = WaitForSingleObjectEx(audioReg->m_audioClientReady, 1000, TRUE)) == WAIT_TIMEOUT) {
OutputDebugStringW(L"Waiting for audio\n");
}
CloseHandle(audioReg->m_audioClientReady);
if (res != WAIT_OBJECT_0) {
OutputDebugString(TEXT("Failure while waiting for audio client"));
return;
}
char ptr_astring[64];
sprintf_s(ptr_astring, "--winstore-audioclient=0x%p", audioReg->m_AudioClient);
argv[nbArgs++] = _strdup(ptr_astring);
char ptr_d3dstring[64];
sprintf_s(ptr_d3dstring, "--winrt-d3ddevice=0x%p", m_dxManager->cp_d3dDevice);
argv[nbArgs++] = _strdup(ptr_d3dstring);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment