[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v1.0-dev-133-g82a84eb
Colin Guthrie
gitmailer-noreply at 0pointer.de
Thu Mar 3 05:32:39 PST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 3f6eb652cba802227f292c207ba9f00a2e4321d7 (commit)
- Log -----------------------------------------------------------------
82a84eb volume: Add a PA_VOLUME_UI_MAX define for the recommended max volume to show in UIs
8c012a6 conf: Make system.pa use udev-detect and not hal-detect.
33d1de4 configure: Drop some warnings
9cbf19b Various fixes for build warnings
53695b8 Get rid of some unused-function compiler warnings
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 2 +-
src/daemon/daemon-conf.c | 6 ++----
src/daemon/default.pa.in | 2 +-
src/daemon/system.pa.in | 6 +++---
src/modules/udev-util.c | 2 +-
src/pulse/volume.c | 2 +-
src/pulse/volume.h | 7 +++++++
src/pulsecore/core-util.c | 4 ++++
src/pulsecore/ltdl-helper.c | 4 ++--
src/pulsecore/memtrap.c | 2 +-
src/pulsecore/shm.c | 2 ++
src/tests/mainloop-test.c | 2 +-
src/tests/mix-test.c | 10 ++--------
src/utils/pacat.c | 2 ++
14 files changed, 30 insertions(+), 23 deletions(-)
-----------------------------------------------------------------------
commit 53695b83dcd15df981b131b2cdd927d9f984a966
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Wed Mar 2 12:41:23 2011 +0100
Get rid of some unused-function compiler warnings
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 3339f3b..e38e67a 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -293,8 +293,8 @@ static int parse_resample_method(const char *filename, unsigned line, const char
return 0;
}
-static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
#ifdef HAVE_SYS_RESOURCE_H
+static int parse_rlimit(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
struct pa_rlimit *r = data;
pa_assert(filename);
@@ -315,12 +315,10 @@ static int parse_rlimit(const char *filename, unsigned line, const char *section
r->is_set = k >= 0;
r->value = k >= 0 ? (rlim_t) k : 0;
}
-#else
- pa_log_warn(_("[%s:%u] rlimit not supported on this platform."), filename, line);
-#endif
return 0;
}
+#endif
static int parse_sample_format(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
pa_daemon_conf *c = data;
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 8a377e3..02e9bf6 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -620,6 +620,7 @@ char *pa_strlcpy(char *b, const char *s, size_t l) {
return b;
}
+#ifdef _POSIX_PRIORITY_SCHEDULING
static int set_scheduler(int rtprio) {
#ifdef HAVE_SCHED_H
struct sched_param sp;
@@ -677,6 +678,7 @@ static int set_scheduler(int rtprio) {
return -1;
}
+#endif
/* Make the current thread a realtime thread, and acquire the highest
* rtprio we can get that is less or equal the specified parameter. If
@@ -713,6 +715,7 @@ int pa_make_realtime(int rtprio) {
return -1;
}
+#ifdef HAVE_SYS_RESOURCE_H
static int set_nice(int nice_level) {
#ifdef HAVE_DBUS
DBusError error;
@@ -757,6 +760,7 @@ static int set_nice(int nice_level) {
return -1;
}
+#endif
/* Raise the priority of the current process as much as possible that
* is <= the specified nice level..*/
diff --git a/src/pulsecore/memtrap.c b/src/pulsecore/memtrap.c
index b56d806..4df1fb7 100644
--- a/src/pulsecore/memtrap.c
+++ b/src/pulsecore/memtrap.c
@@ -67,11 +67,11 @@ pa_bool_t pa_memtrap_is_good(pa_memtrap *m) {
return !pa_atomic_load(&m->bad);
}
+#ifdef HAVE_SIGACTION
static void sigsafe_error(const char *s) {
(void) write(STDERR_FILENO, s, strlen(s));
}
-#ifdef HAVE_SIGACTION
static void signal_handler(int sig, siginfo_t* si, void *data) {
unsigned j;
pa_memtrap *m;
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c
index 5d5d85a..da8aff7 100644
--- a/src/pulsecore/shm.c
+++ b/src/pulsecore/shm.c
@@ -90,10 +90,12 @@ struct shm_marker {
#define SHM_MARKER_SIZE PA_ALIGN(sizeof(struct shm_marker))
+#ifdef HAVE_SHM_OPEN
static char *segment_name(char *fn, size_t l, unsigned id) {
pa_snprintf(fn, l, "/pulse-shm-%u", id);
return fn;
}
+#endif
int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) {
char fn[32];
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 79936fd..6cd01d2 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -604,6 +604,7 @@ static void stream_update_timing_callback(pa_stream *s, int success, void *userd
fprintf(stderr, " \r");
}
+#ifdef SIGUSR1
/* Someone requested that the latency is shown */
static void sigusr1_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
@@ -612,6 +613,7 @@ static void sigusr1_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int s
pa_operation_unref(pa_stream_update_timing_info(stream, stream_update_timing_callback, NULL));
}
+#endif
static void time_event_callback(pa_mainloop_api *m, pa_time_event *e, const struct timeval *t, void *userdata) {
if (stream && pa_stream_get_state(stream) == PA_STREAM_READY) {
commit 9cbf19b59b3db50f2f91fdf5aa206889d97ed057
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Wed Mar 2 12:41:24 2011 +0100
Various fixes for build warnings
diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c
index 52df103..356f773 100644
--- a/src/modules/udev-util.c
+++ b/src/modules/udev-util.c
@@ -74,7 +74,7 @@ static int dehex(char x) {
static void proplist_sets_unescape(pa_proplist *p, const char *prop, const char *s) {
const char *f;
char *t, *r;
- int c;
+ int c = 0;
enum {
TEXT,
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index f74d720..c1f4dad 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -263,7 +263,7 @@ pa_volume_t pa_sw_volume_from_linear(double v) {
* same volume value! That's why we need the lround() below!
*/
- return (pa_volume_t) PA_CLAMP_VOLUME(lround(cbrt(v) * PA_VOLUME_NORM));
+ return (pa_volume_t) PA_CLAMP_VOLUME((uint64_t) lround(cbrt(v) * PA_VOLUME_NORM));
}
double pa_sw_volume_to_linear(pa_volume_t v) {
diff --git a/src/pulsecore/ltdl-helper.c b/src/pulsecore/ltdl-helper.c
index be200ca..1a0e555 100644
--- a/src/pulsecore/ltdl-helper.c
+++ b/src/pulsecore/ltdl-helper.c
@@ -42,7 +42,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
pa_assert(handle);
pa_assert(symbol);
- *(void**) &f = lt_dlsym(handle, symbol);
+ f = (pa_void_func_t) lt_dlsym(handle, symbol);
if (f)
return f;
@@ -59,7 +59,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
if (!isalnum(*c))
*c = '_';
- *(void**) &f = lt_dlsym(handle, sn);
+ f = (pa_void_func_t) lt_dlsym(handle, sn);
pa_xfree(sn);
return f;
diff --git a/src/tests/mainloop-test.c b/src/tests/mainloop-test.c
index 3ec6d11..cd54bcf 100644
--- a/src/tests/mainloop-test.c
+++ b/src/tests/mainloop-test.c
@@ -48,7 +48,7 @@ static pa_defer_event *de;
static void iocb(pa_mainloop_api*a, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {
unsigned char c;
- (void) read(fd, &c, sizeof(c));
+ pa_assert_se(read(fd, &c, sizeof(c)) >= 0);
fprintf(stderr, "IO EVENT: %c\n", c < 32 ? '.' : c);
a->defer_enable(de, 1);
}
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 457c4ac..55844e7 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -32,12 +32,6 @@
#include <pulsecore/memblock.h>
#include <pulsecore/sample-util.h>
-static float swap_float(float a) {
- uint32_t *b = (uint32_t*) &a;
- *b = PA_UINT32_SWAP(*b);
- return a;
-}
-
static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
void *d;
unsigned i;
@@ -96,7 +90,7 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
float *u = d;
for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
- printf("%1.5f ", ss->format == PA_SAMPLE_FLOAT32NE ? *u : swap_float(*u));
+ printf("%1.5f ", ss->format == PA_SAMPLE_FLOAT32NE ? *u : PA_FLOAT32_SWAP(*u));
u++;
}
@@ -188,7 +182,7 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
if (ss->format == PA_SAMPLE_FLOAT32RE) {
for (i = 0; i < 10; i++)
- u[i] = swap_float(float_samples[i]);
+ u[i] = PA_FLOAT32_SWAP(float_samples[i]);
} else
memcpy(d, float_samples, sizeof(float_samples));
commit 33d1de487a231ffa633b8d0f77c1e16f5a43d981
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Wed Mar 2 12:41:25 2011 +0100
configure: Drop some warnings
Drop -Winline and set -Wstrict-aliasing level to its default.
diff --git a/configure.ac b/configure.ac
index 2171089..9b73bc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,7 @@ if test "x$M4" = xno ; then
fi
dnl Compiler flags
-CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option])
+CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option])
dnl Linker flags.
dnl Check whether the linker supports the -version-script option.
commit 8c012a676db185e07b6c0f0507b496335ba2ab6c
Author: Colin Guthrie <cguthrie at mandriva.org>
Date: Thu Mar 3 09:37:16 2011 +0000
conf: Make system.pa use udev-detect and not hal-detect.
Also fix a left over reference to HAL in default.pa
diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
index ace0f09..32ba582 100755
--- a/src/daemon/default.pa.in
+++ b/src/daemon/default.pa.in
@@ -39,7 +39,7 @@ load-module module-card-restore
load-module module-augment-properties
### Load audio drivers statically (it's probably better to not load
-### these drivers manually, but instead use module-hal-detect --
+### these drivers manually, but instead use module-udev-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
diff --git a/src/daemon/system.pa.in b/src/daemon/system.pa.in
index 0ca32bd..aaefd1d 100755
--- a/src/daemon/system.pa.in
+++ b/src/daemon/system.pa.in
@@ -20,11 +20,11 @@
# mode.
### Automatically load driver modules depending on the hardware available
-.ifexists module-hal-detect at PA_SOEXT@
-load-module module-hal-detect
+.ifexists module-udev-detect at PA_SOEXT@
+load-module module-udev-detect
.else
### Alternatively use the static hardware detection module (for systems that
-### lack HAL support)
+### lack udev support)
load-module module-detect
.endif
commit 82a84eb1bd03936218de93ca3e59cb37cdaf9328
Author: Colin Guthrie <cguthrie at mandriva.org>
Date: Thu Mar 3 12:04:31 2011 +0000
volume: Add a PA_VOLUME_UI_MAX define for the recommended max volume to show in UIs
This value is not a technical upper limit, it's just a 'sensible'
value that is not crazy high, but also allows software amplification
above 0dB (aka 100%) for very quiet audio sources.
We recommend that a comprehensive volume control UI should allow
users to set volumes up to this limit, although of course should
deal gracefully if the user has set the volume even higher than this
without resulting in a feedback loop that effectively limits the
upper volume.
The value chosen is +11dB. This was selected somewhat subjectively
and is very similar to the current 150% that gnome-volume-control
uses (which is ~+10.57dB).
On the plus side, we now recommend that everyone allows
'Volumes up to 11' which is pretty awesome.
http://en.wikipedia.org/wiki/Up_to_eleven
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-April/006945.html
https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-April/006950.html
diff --git a/src/pulse/volume.h b/src/pulse/volume.h
index 91eef74..abf930e 100644
--- a/src/pulse/volume.h
+++ b/src/pulse/volume.h
@@ -115,6 +115,13 @@ typedef uint32_t pa_volume_t;
/** Maximum valid volume we can store. \since 0.9.15 */
#define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX/2)
+/** Recommended maximum volume to show in user facing UIs.
+ * Note: UIs should deal gracefully with volumes greater than this value
+ * and not cause feedback loops etc. - i.e. if the volume is more than
+ * this, the UI should not limit it and push the limited value back to
+ * the server. \since 0.9.23 */
+#define PA_VOLUME_UI_MAX (pa_sw_volume_from_dB(+11.0))
+
/** Special 'invalid' volume. \since 0.9.16 */
#define PA_VOLUME_INVALID ((pa_volume_t) UINT32_MAX)
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list