diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-04-16 19:35:07 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-04-16 19:35:07 +0530 |
commit | ff17a404b31d214952c248885bd957fcf5bcf5a0 (patch) | |
tree | a5fc540fba572e96e1a6a01b7628e8d18bb05646 /sys/wasapi/gstwasapisrc.c | |
parent | b476893560c49c991cbfb8f58d9c8f722dacf53c (diff) | |
download | gstreamer-plugins-bad-ff17a404b31d214952c248885bd957fcf5bcf5a0.tar.gz |
wasapi: Call CoIn/Uninitialize() around prepare()
Seems to be required for exclusive mode and also for all
initialization on Windows 7
https://bugzilla.gnome.org/show_bug.cgi?id=795274
Diffstat (limited to 'sys/wasapi/gstwasapisrc.c')
-rw-r--r-- | sys/wasapi/gstwasapisrc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/wasapi/gstwasapisrc.c b/sys/wasapi/gstwasapisrc.c index 4c51a4024..c57d577fb 100644 --- a/sys/wasapi/gstwasapisrc.c +++ b/sys/wasapi/gstwasapisrc.c @@ -436,6 +436,8 @@ gst_wasapi_src_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec) 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, @@ -517,10 +519,6 @@ gst_wasapi_src_unprepare (GstAudioSrc * asrc) { 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); @@ -543,6 +541,8 @@ gst_wasapi_src_unprepare (GstAudioSrc * asrc) self->client_clock_freq = 0; + CoUninitialize (); + return TRUE; } |