guint bpf, rate, devicep_frames;
HRESULT hr;
+ CoInitialize (NULL);
+
if (gst_wasapi_sink_can_audioclient3 (self)) {
if (!gst_wasapi_util_initialize_audioclient3 (GST_ELEMENT (self), spec,
(IAudioClient3 *) self->client, self->mix_format, self->low_latency,
{
GstWasapiSink *self = GST_WASAPI_SINK (asink);
- if (self->sharemode == AUDCLNT_SHAREMODE_EXCLUSIVE &&
- !gst_wasapi_sink_can_audioclient3 (self))
- CoUninitialize ();
+ CoUninitialize ();
if (self->thread_priority_handle != NULL) {
gst_wasapi_util_revert_thread_characteristics
self->render_client = NULL;
}
+ CoUninitialize ();
+
return TRUE;
}
guint bpf, rate, devicep_frames, buffer_frames;
HRESULT hr;
+ CoInitialize (NULL);
+
if (gst_wasapi_src_can_audioclient3 (self)) {
if (!gst_wasapi_util_initialize_audioclient3 (GST_ELEMENT (self), spec,
(IAudioClient3 *) self->client, self->mix_format, self->low_latency,
{
GstWasapiSrc *self = GST_WASAPI_SRC (asrc);
- if (self->sharemode == AUDCLNT_SHAREMODE_EXCLUSIVE &&
- !gst_wasapi_src_can_audioclient3 (self))
- CoUninitialize ();
-
if (self->thread_priority_handle != NULL) {
gst_wasapi_util_revert_thread_characteristics
(self->thread_priority_handle);
self->client_clock_freq = 0;
+ CoUninitialize ();
+
return TRUE;
}
min_period, &device_period, &device_buffer_duration);
}
- /* For some reason, we need to call this a second time for exclusive mode */
- if (sharemode == AUDCLNT_SHAREMODE_EXCLUSIVE)
- CoInitialize (NULL);
-
stream_flags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
if (loopback)
stream_flags |= AUDCLNT_STREAMFLAGS_LOOPBACK;