diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-06-30 14:48:09 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-06-30 14:53:25 +0300 |
commit | 6d0007372b317b049f475fab0df0ea03195332dc (patch) | |
tree | c533449b1258ea50af5f4d76f168c3bd45f318dd | |
parent | ce7a24cbd99302a685d0f2f9c0fd767eb7b619d6 (diff) |
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.
-rw-r--r-- | ext/pulse/pulsesink.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index a261c1eb1..c3f37548d 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -64,2 +64,3 @@ GST_DEBUG_CATEGORY_EXTERN (pulse_debug); #define DEFAULT_VOLUME 1.0 +#define MAX_VOLUME 10.0 @@ -1400,3 +1401,3 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass) 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)); @@ -1601,2 +1602,7 @@ unlock: + if (v > MAX_VOLUME) { + GST_WARNING_OBJECT (psink, "Clipped volume from %f to %f", v, MAX_VOLUME); + v = MAX_VOLUME; + } + return v; |