wasapi: use Windows common Sleep() API instead of PA_Sleep()

use GetTickCount64() API which is awailable for Windows Store app instead of _ftime_s()
remove WAVEFORMAT and WAVEFORMATEX declaration and use the corresponding Windows include file instead
This commit is contained in:
dmitrykos 2016-08-14 10:52:36 +03:00
commit 326549c55e
3 changed files with 6 additions and 35 deletions

View file

@ -149,9 +149,7 @@ double PaUtil_GetTime( void )
{
#ifndef UNDER_CE
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
struct _timeb tv = { 0 };
_ftime_s(&tv);
return (double)tv.time + tv.millitm * .001;
return GetTickCount64() * .001;
#else
return timeGetTime() * .001;
#endif

View file

@ -38,6 +38,9 @@
#include <windows.h>
#include <mmsystem.h>
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#include <mmreg.h> /* for WAVEFORMATEX */
#endif
#include "portaudio.h"
#include "pa_win_waveformat.h"
@ -48,36 +51,6 @@
#endif
#if !defined(WAVE_FORMAT_PCM)
#define WAVE_FORMAT_PCM 1
typedef struct tWAVEFORMAT
{
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
}
WAVEFORMAT;
#endif
#if !defined(_WAVEFORMATEX_)
#define _WAVEFORMATEX_
typedef struct tWAVEFORMATEX
{
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
WORD wBitsPerSample;
WORD cbSize;
}
WAVEFORMATEX;
#endif
static GUID pawin_ksDataFormatSubtypeGuidBase =
{ (USHORT)(WAVE_FORMAT_PCM), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 };