diff --git a/make/javax/sound/jsoundds/Makefile b/make/javax/sound/jsoundds/Makefile index 178212437c7085dcb0af9d4592895edc56e8881d..e38a98535efc7f1caff976ffcbecb8c4d1a0be38 100644 --- a/make/javax/sound/jsoundds/Makefile +++ b/make/javax/sound/jsoundds/Makefile @@ -53,7 +53,7 @@ FILES_export = \ # # Extra cc/linker flags. # -LDLIBS += dsound.lib winmm.lib user32.lib +LDLIBS += dsound.lib winmm.lib user32.lib ole32.lib CPPFLAGS += \ -DUSE_DAUDIO=TRUE \ -I$(SHARE_SRC)/native/com/sun/media/sound \ diff --git a/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp b/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp index e17de1b87550ead21849034a356702a6e61f0a04..5b80dd00ef7194c9e31473113e643e1e5236e2a7 100644 --- a/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp +++ b/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp @@ -476,6 +476,7 @@ DS_StartBufferHelper::Data::~Data() { DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param) { + ::CoInitialize(NULL); while (1) { // wait for something to do ::WaitForSingleObject(data.startEvent, INFINITE); @@ -492,6 +493,7 @@ DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param) } ::SetEvent(data.startedEvent); } + ::CoUninitialize(); return 0; }