From: Arun Raghavan Date: Thu, 20 Sep 2012 17:58:12 +0000 (+0200) Subject: pulsesrc: Mute stream post-connection if required X-Git-Tag: 1.19.3~509^2~6516 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=027cc0e4639264450a6a0306000e5d9c701479e3;p=platform%2Fupstream%2Fgstreamer.git 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 . https://bugzilla.gnome.org/show_bug.cgi?id=684469 --- diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c index 61bf307..6003d13 100644 --- a/ext/pulse/pulsesrc.c +++ b/ext/pulse/pulsesrc.c @@ -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;