mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-11 22:31:22 +00:00
wasapi2: Ensure unmute when opening audio client
ISimpleAudioVolume::SetMute() status seems to be preserved even after process is terminated. In order to start audio client with unmuted state, always disable mute when opening audio client. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1731>
This commit is contained in:
parent
83e4310da1
commit
be0df31b15
1 changed files with 14 additions and 0 deletions
|
@ -863,6 +863,11 @@ run_loop:
|
||||||
gst_wasapi2_client_stop (self);
|
gst_wasapi2_client_stop (self);
|
||||||
|
|
||||||
if (self->audio_volume) {
|
if (self->audio_volume) {
|
||||||
|
/* this mute state seems to be global setting for this device
|
||||||
|
* Explicitly disable mute for later use of this audio device
|
||||||
|
* by other application. Otherwise users would blame GStreamer
|
||||||
|
* if we close audio device with muted state */
|
||||||
|
self->audio_volume->SetMute(FALSE, nullptr);
|
||||||
self->audio_volume->Release ();
|
self->audio_volume->Release ();
|
||||||
self->audio_volume = NULL;
|
self->audio_volume = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1343,6 +1348,15 @@ gst_wasapi2_client_open (GstWasapi2Client * client, GstAudioRingBufferSpec * spe
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
gst_audio_ring_buffer_set_channel_positions (buf, client->positions);
|
gst_audio_ring_buffer_set_channel_positions (buf, client->positions);
|
||||||
|
|
||||||
client->opened = TRUE;
|
client->opened = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue