USA.
***/
+#include <inttypes.h>
+#include <limits.h>
+
#include <pulse/gccmacro.h>
#include <pulse/sample.h>
#include <pulse/volume.h>
void pa_sample_clamp(pa_sample_format_t format, void *dst, size_t dstr, const void *src, size_t sstr, unsigned n);
+static inline int32_t pa_mult_s16_volume(int16_t v, int32_t cv) {
+#if __WORDSIZE == 64 || ((ULONG_MAX) > (UINT_MAX))
+ /* Multiply with 64 bit integers on 64 bit platforms */
+ return (v * (int64_t) cv) >> 16;
+#else
+ /* Multiplying the 32 bit volume factor with the
+ * 16 bit sample might result in an 48 bit value. We
+ * want to do without 64 bit integers and hence do
+ * the multiplication independently for the HI and
+ * LO part of the volume. */
+
+ int32_t hi = cv >> 16;
+ int32_t lo = cv & 0xFFFF;
+ return ((v * lo) >> 16) + (v * hi);
+#endif
+}
+
pa_usec_t pa_bytes_to_usec_round_up(uint64_t length, const pa_sample_spec *spec);
size_t pa_usec_to_bytes_round_up(pa_usec_t t, const pa_sample_spec *spec);