summaryrefslogtreecommitdiffstats
path: root/polyp/sample.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-08-14 20:25:32 +0000
committerLennart Poettering <lennart@poettering.net>2004-08-14 20:25:32 +0000
commit22cb23eedb2eae7c79dc8fcf395be08bfc666256 (patch)
treef0993d4a26cb6e311d052b40ac5b8efc1239c145 /polyp/sample.c
parent1c2ec47cf1506ad1c75c088d476ae382170df62c (diff)
implement proper refcounting in polyplib
split polyplib to multiple modules add some prelimenary documentation add doxygen support git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@123 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/sample.c')
-rw-r--r--polyp/sample.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/polyp/sample.c b/polyp/sample.c
index e4c4bd52..4f93f2b7 100644
--- a/polyp/sample.c
+++ b/polyp/sample.c
@@ -96,3 +96,11 @@ void pa_sample_snprint(char *s, size_t l, const struct pa_sample_spec *spec) {
assert(pa_sample_spec_valid(spec));
snprintf(s, l, "%s %uch %uHz", table[spec->format], spec->channels, spec->rate);
}
+
+uint32_t pa_volume_multiply(uint32_t a, uint32_t b) {
+ uint64_t p = a;
+ p *= b;
+ p /= PA_VOLUME_NORM;
+
+ return (uint32_t) p;
+}