|
@@ -28,6 +28,12 @@
|
|
|
#include "audio-io.h"
|
|
|
#include "audio-resampler.h"
|
|
|
|
|
|
+#ifdef _WIN32
|
|
|
+#define WIN32_LEAN_AND_MEAN
|
|
|
+#include <Windows.h>
|
|
|
+#include <avrt.h>
|
|
|
+#endif
|
|
|
+
|
|
|
extern profiler_name_store_t *obs_get_profiler_name_store(void);
|
|
|
|
|
|
/* #define DEBUG_AUDIO */
|
|
@@ -197,6 +203,11 @@ static void input_and_output(struct audio_output *audio, uint64_t audio_time,
|
|
|
|
|
|
static void *audio_thread(void *param)
|
|
|
{
|
|
|
+#ifdef _WIN32
|
|
|
+ DWORD unused = 0;
|
|
|
+ const HANDLE handle = AvSetMmThreadCharacteristics(L"Audio", &unused);
|
|
|
+#endif
|
|
|
+
|
|
|
struct audio_output *audio = param;
|
|
|
size_t rate = audio->info.samples_per_sec;
|
|
|
uint64_t samples = 0;
|
|
@@ -234,6 +245,11 @@ static void *audio_thread(void *param)
|
|
|
profile_reenable_thread();
|
|
|
}
|
|
|
|
|
|
+#ifdef _WIN32
|
|
|
+ if (handle)
|
|
|
+ AvRevertMmThreadCharacteristics(handle);
|
|
|
+#endif
|
|
|
+
|
|
|
return NULL;
|
|
|
}
|
|
|
|