mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
wasapi2: Use AUDCLNT_STREAMFLAGS_NOPERSIST flag
... so that we can disable persistence of our mute/volume status Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2306>
This commit is contained in:
parent
d5384ffbd0
commit
4b42671c99
1 changed files with 4 additions and 9 deletions
|
@ -1210,6 +1210,8 @@ gst_wasapi2_client_initialize_audio_client3 (GstWasapi2Client * self)
|
||||||
{
|
{
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
UINT32 default_period, fundamental_period, min_period, max_period;
|
UINT32 default_period, fundamental_period, min_period, max_period;
|
||||||
|
/* AUDCLNT_STREAMFLAGS_NOPERSIST is not allowed for
|
||||||
|
* InitializeSharedAudioStream */
|
||||||
DWORD stream_flags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
|
DWORD stream_flags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
|
||||||
WAVEFORMATEX *format = NULL;
|
WAVEFORMATEX *format = NULL;
|
||||||
UINT32 period;
|
UINT32 period;
|
||||||
|
@ -1282,7 +1284,8 @@ gst_wasapi2_client_initialize_audio_client (GstWasapi2Client * self,
|
||||||
REFERENCE_TIME default_period, min_period;
|
REFERENCE_TIME default_period, min_period;
|
||||||
REFERENCE_TIME device_period, device_buffer_duration;
|
REFERENCE_TIME device_period, device_buffer_duration;
|
||||||
guint rate;
|
guint rate;
|
||||||
DWORD stream_flags = AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
|
DWORD stream_flags =
|
||||||
|
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
IAudioClient3 *audio_client = self->audio_client;
|
IAudioClient3 *audio_client = self->audio_client;
|
||||||
|
|
||||||
|
@ -1440,14 +1443,6 @@ gst_wasapi2_client_open (GstWasapi2Client * client,
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
client->audio_volume = audio_volume.Detach ();
|
client->audio_volume = audio_volume.Detach ();
|
||||||
|
|
||||||
/* this mute state seems to be global setting for this device
|
|
||||||
* but below documentation looks unclear why mute state is preserved
|
|
||||||
* even after process is terminated
|
|
||||||
* https://docs.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-isimpleaudiovolume-setmute
|
|
||||||
* Explicitly disable mute so that ensure we can produce or play audio
|
|
||||||
* regardless of previous status
|
|
||||||
*/
|
|
||||||
client->audio_volume->SetMute (FALSE, nullptr);
|
client->audio_volume->SetMute (FALSE, nullptr);
|
||||||
|
|
||||||
gst_audio_ring_buffer_set_channel_positions (buf, client->positions);
|
gst_audio_ring_buffer_set_channel_positions (buf, client->positions);
|
||||||
|
|
Loading…
Reference in a new issue