Browse Source
Merge pull request #2220 from lioncash/cubeb
audio_core/cubeb_sink: Convert _MSC_VER ifdefs to _WIN32
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
4 deletions
-
src/audio_core/cubeb_sink.cpp
-
src/audio_core/cubeb_sink.h
|
|
|
@ -12,7 +12,7 @@ |
|
|
|
#include "common/ring_buffer.h"
|
|
|
|
#include "core/settings.h"
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <objbase.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@ -113,7 +113,7 @@ private: |
|
|
|
|
|
|
|
CubebSink::CubebSink(std::string_view target_device_name) { |
|
|
|
// Cubeb requires COM to be initialized on the thread calling cubeb_init on Windows
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#ifdef _WIN32
|
|
|
|
com_init_result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); |
|
|
|
#endif
|
|
|
|
|
|
|
|
@ -152,7 +152,7 @@ CubebSink::~CubebSink() { |
|
|
|
|
|
|
|
cubeb_destroy(ctx); |
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#ifdef _WIN32
|
|
|
|
if (SUCCEEDED(com_init_result)) { |
|
|
|
CoUninitialize(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -26,7 +26,7 @@ private: |
|
|
|
cubeb_devid output_device{}; |
|
|
|
std::vector<SinkStreamPtr> sink_streams; |
|
|
|
|
|
|
|
#ifdef _MSC_VER |
|
|
|
#ifdef _WIN32 |
|
|
|
u32 com_init_result = 0; |
|
|
|
#endif |
|
|
|
}; |
|
|
|
|