Skip to content

Commit 055fda9

Browse files
committed
Viewer: target Windows 10 and avoid Propsys.lib
XAudio2Create is only exposed inline in xaudio2.h when targeting _WIN32_WINNT >= 0x0A00, otherwise it's an unresolved import. The MSIX already requires Windows 10 1809+ so this is consistent. Also construct PROPVARIANT directly instead of pulling in Propsys.lib for InitPropVariantFromInt64.
1 parent 2fef486 commit 055fda9

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

Viewer/AudioPlayer.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#include "stdafx.h"
22
#include "AudioPlayer.h"
33
#include <mfapi.h>
4-
#include <propvarutil.h>
54

65
#pragma comment(lib, "mfplat.lib")
76
#pragma comment(lib, "mfreadwrite.lib")
87
#pragma comment(lib, "mfuuid.lib")
9-
#pragma comment(lib, "Propsys.lib")
108

119
using Microsoft::WRL::ComPtr;
1210

@@ -107,10 +105,10 @@ void AudioPlayer::Close()
107105

108106
bool AudioPlayer::SeekReader(double timeSec)
109107
{
110-
PROPVARIANT var;
111-
InitPropVariantFromInt64(static_cast<LONGLONG>(timeSec * 1e7), &var); // 100-ns units
108+
PROPVARIANT var = {};
109+
var.vt = VT_I8;
110+
var.hVal.QuadPart = static_cast<LONGLONG>(timeSec * 1e7); // 100-ns units
112111
HRESULT hr = mReader->SetCurrentPosition(GUID_NULL, var);
113-
PropVariantClear(&var);
114112
return SUCCEEDED(hr);
115113
}
116114

Viewer/targetver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
// Modify the following defines if you have to target a platform prior to the ones specified below.
1010
// Refer to MSDN for the latest info on corresponding values for different platforms.
11-
#ifndef WINVER // Minimum required platform: Windows 8 (XAudio2 needs Win8+).
12-
#define WINVER 0x0602
11+
#ifndef WINVER // Minimum required platform: Windows 10 (matches the MSIX target;
12+
#define WINVER 0x0A00 // gives us the inline XAudio2Create from xaudio2.h).
1313
#endif
1414

1515
#ifndef _WIN32_WINNT
16-
#define _WIN32_WINNT 0x0602
16+
#define _WIN32_WINNT 0x0A00
1717
#endif
1818

1919
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.

0 commit comments

Comments
 (0)