Commit 027cc0e4 authored by Arun Raghavan's avatar Arun Raghavan

pulsesrc: Mute stream post-connection if required

A bug in PulseAudio causes PA_STREAM_START_MUTED to be rejected on
record streams. Until this is fixed upstream, we mute the stream
manually at startup. Based on a patch by Alban Browaeys
<prahal@yahoo.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=684469
parent 10269703
......@@ -1431,9 +1431,6 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
PA_STREAM_NOT_MONOTONIC | PA_STREAM_ADJUST_LATENCY |
PA_STREAM_START_CORKED;
if (pulsesrc->mute_set && pulsesrc->mute)
flags |= PA_STREAM_START_MUTED;
if (pa_stream_connect_record (pulsesrc->stream, pulsesrc->device, &wanted,
flags) < 0) {
goto connect_failed;
......@@ -1465,6 +1462,15 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
pulsesrc->source_output_idx = pa_stream_get_index (pulsesrc->stream);
g_object_notify (G_OBJECT (pulsesrc), "source-output-index");
/* Although source output stream muting is supported, there is a bug in
* PulseAudio that doesn't allow us to do this at startup, so we mute
* manually post-connect. This should be moved back pre-connect once things
* are fixed on the PulseAudio side. */
if (pulsesrc->mute_set && pulsesrc->mute) {
gst_pulsesrc_set_stream_mute (pulsesrc, pulsesrc->mute);
pulsesrc->mute_set = FALSE;
}
if (pulsesrc->volume_set) {
gst_pulsesrc_set_stream_volume (pulsesrc, pulsesrc->volume);
pulsesrc->volume_set = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment