mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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
This commit is contained in:
parent
4d72fd9884
commit
fb5a5c069c
1 changed files with 10 additions and 5 deletions
|
@ -548,6 +548,7 @@ gst_directsound_sink_prepare (GstAudioSink * asink,
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_directsound_sink_set_volume (dsoundsink, dsoundsink->volume, FALSE);
|
gst_directsound_sink_set_volume (dsoundsink, dsoundsink->volume, FALSE);
|
||||||
|
gst_directsound_sink_set_mute (dsoundsink, dsoundsink->mute);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -896,10 +897,10 @@ gst_directsound_sink_set_volume (GstDirectSoundSink * dsoundsink,
|
||||||
* here, so remap.
|
* here, so remap.
|
||||||
*/
|
*/
|
||||||
long dsVolume;
|
long dsVolume;
|
||||||
if (dsoundsink->volume == 0)
|
if (volume == 0)
|
||||||
dsVolume = -10000;
|
dsVolume = -10000;
|
||||||
else
|
else
|
||||||
dsVolume = 100 * (long) (20 * log10 ((double) dsoundsink->volume / 100.));
|
dsVolume = 100 * (long) (20 * log10 ((double) volume / 100.));
|
||||||
dsVolume = CLAMP (dsVolume, -10000, 0);
|
dsVolume = CLAMP (dsVolume, -10000, 0);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dsoundsink,
|
GST_DEBUG_OBJECT (dsoundsink,
|
||||||
|
@ -918,16 +919,20 @@ gst_directsound_sink_get_volume (GstDirectSoundSink * dsoundsink)
|
||||||
static void
|
static void
|
||||||
gst_directsound_sink_set_mute (GstDirectSoundSink * dsoundsink, gboolean mute)
|
gst_directsound_sink_set_mute (GstDirectSoundSink * dsoundsink, gboolean mute)
|
||||||
{
|
{
|
||||||
if (mute)
|
if (mute) {
|
||||||
gst_directsound_sink_set_volume (dsoundsink, 0, FALSE);
|
gst_directsound_sink_set_volume (dsoundsink, 0, FALSE);
|
||||||
else
|
dsoundsink->mute = TRUE;
|
||||||
|
} else {
|
||||||
gst_directsound_sink_set_volume (dsoundsink, dsoundsink->volume, FALSE);
|
gst_directsound_sink_set_volume (dsoundsink, dsoundsink->volume, FALSE);
|
||||||
|
dsoundsink->mute = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_directsound_sink_get_mute (GstDirectSoundSink * dsoundsink)
|
gst_directsound_sink_get_mute (GstDirectSoundSink * dsoundsink)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return dsoundsink->mute;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
|
|
Loading…
Reference in a new issue