From 6d0007372b317b049f475fab0df0ea03195332dc Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 30 Jun 2009 14:48:09 +0300 Subject: pulsesink: include "1.0=100%" in volume and change upper limit Upper volume limmit was 1000. That appear unneceasrily high. It would also cause sever distortion if accidentialy used. Now its 10 (~ +15db) which is also in sync with volume and playbin2. --- ext/pulse/pulsesink.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/pulse/pulsesink.c') diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index a261c1eb..c3f37548 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -62,6 +62,7 @@ GST_DEBUG_CATEGORY_EXTERN (pulse_debug); #define DEFAULT_DEVICE NULL #define DEFAULT_DEVICE_NAME NULL #define DEFAULT_VOLUME 1.0 +#define MAX_VOLUME 10.0 enum { @@ -1398,7 +1399,7 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass) g_object_class_install_property (gobject_class, PROP_VOLUME, g_param_spec_double ("volume", "Volume", - "Volume of this stream", 0.0, 1000.0, DEFAULT_VOLUME, + "Volume of this stream, 1.0=100%", 0.0, MAX_VOLUME, DEFAULT_VOLUME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); #endif } @@ -1599,6 +1600,11 @@ unlock: v = psink->volume; pa_threaded_mainloop_unlock (psink->mainloop); + if (v > MAX_VOLUME) { + GST_WARNING_OBJECT (psink, "Clipped volume from %f to %f", v, MAX_VOLUME); + v = MAX_VOLUME; + } + return v; /* ERRORS */ -- cgit