Skip to content

Commit

Permalink
Updated XAudio2 driver and disabled floating point output for DirectS…
Browse files Browse the repository at this point in the history
…ound
  • Loading branch information
kode54 committed Aug 25, 2012
1 parent 9f209e3 commit 76deabd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
10 changes: 6 additions & 4 deletions driver_new/sound_out_xaudio2.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "stdafx.h"

#include "sound_out.h"

//#define HAVE_KS_HEADERS
Expand Down Expand Up @@ -110,8 +108,12 @@ class XAudio2_Device_Notifier : public IMMNotificationClient
{
if ( InterlockedDecrement( &registered ) == 0 )
{
pEnumerator->UnregisterEndpointNotificationCallback( this );
pEnumerator->Release();
if (pEnumerator)
{
pEnumerator->UnregisterEndpointNotificationCallback( this );
pEnumerator->Release();
pEnumerator = NULL;
}
registered = false;
}

Expand Down
22 changes: 1 addition & 21 deletions driver_new/vstmididrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,25 +274,6 @@ int vstsyn_play_some_data(void){
return played;
}

BOOL IsVistaOrNewer() {
static bool initialized = false;
static BOOL is_vista;
if (!initialized) {
OSVERSIONINFOEX osvi;
BOOL bOsVersionInfoEx;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*) &osvi);
if(bOsVersionInfoEx == FALSE) is_vista = FALSE;
else if ( VER_PLATFORM_WIN32_NT==osvi.dwPlatformId &&
osvi.dwMajorVersion > 5 )
is_vista = TRUE;
initialized = true;
}
return is_vista;
}


unsigned __stdcall threadfunc(LPVOID lpV){
unsigned i;
int opend;
Expand All @@ -313,8 +294,7 @@ unsigned __stdcall threadfunc(LPVOID lpV){
if (err) {
delete sound_driver;
sound_driver = create_sound_out_ds();
err = sound_driver->open(GetDesktopWindow(), 44100, 2, !!(floating_point = IsVistaOrNewer()), 44 * 2, 100);
if (err && floating_point) err = sound_driver->open(GetDesktopWindow(), 44100, 2, floating_point = FALSE, 44 * 2, 100);
err = sound_driver->open(GetDesktopWindow(), 44100, 2, floating_point = FALSE, 44 * 2, 100);
}
if (err) {
delete sound_driver;
Expand Down

0 comments on commit 76deabd

Please sign in to comment.