Commit fb5a5c06 authored by Thomas Roos's avatar Thomas Roos Committed by Sebastian Dröge

directsoundsink: Fix handling of the mute property

- set mute value at startup
- correct set and get mute functions

https://bugzilla.gnome.org/show_bug.cgi?id=755106
parent 4d72fd98
......@@ -548,6 +548,7 @@ gst_directsound_sink_prepare (GstAudioSink * asink,
}
gst_directsound_sink_set_volume (dsoundsink, dsoundsink->volume, FALSE);
gst_directsound_sink_set_mute (dsoundsink, dsoundsink->mute);
return TRUE;
}
......@@ -896,10 +897,10 @@ gst_directsound_sink_set_volume (GstDirectSoundSink * dsoundsink,
* here, so remap.
*/
long dsVolume;
if (dsoundsink->volume == 0)
if (volume == 0)
dsVolume = -10000;
else
dsVolume = 100 * (long) (20 * log10 ((double) dsoundsink->volume / 100.));
dsVolume = 100 * (long) (20 * log10 ((double) volume / 100.));
dsVolume = CLAMP (dsVolume, -10000, 0);
GST_DEBUG_OBJECT (dsoundsink,
......@@ -918,16 +919,20 @@ gst_directsound_sink_get_volume (GstDirectSoundSink * dsoundsink)
static void
gst_directsound_sink_set_mute (GstDirectSoundSink * dsoundsink, gboolean mute)
{
if (mute)
if (mute) {
gst_directsound_sink_set_volume (dsoundsink, 0, FALSE);
else
dsoundsink->mute = TRUE;
} else {
gst_directsound_sink_set_volume (dsoundsink, dsoundsink->volume, FALSE);
dsoundsink->mute = FALSE;
}
}
static gboolean
gst_directsound_sink_get_mute (GstDirectSoundSink * dsoundsink)
{
return FALSE;
return dsoundsink->mute;
}
static const gchar *
......
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