Module: wine Branch: master Commit: b8e912f795d1f7dd4938663fe5f902a09dd977dd URL: https://gitlab.winehq.org/wine/wine/-/commit/b8e912f795d1f7dd4938663fe5f902a...
Author: Zebediah Figura zfigura@codeweavers.com Date: Sun Jan 29 15:08:27 2023 -0600
winepulse: Include mult.c in pulse.c.
Originally meant to address the fact that mult_alaw_sample() and mult_ulaw_sample() were exported without being hidden, but this file is only used from pulse.c, and is relatively quite simple, so just make them static and use the preprocessor instead of linking.
---
dlls/winepulse.drv/Makefile.in | 1 - dlls/winepulse.drv/{mult.c => mult.h} | 9 ++------- dlls/winepulse.drv/pulse.c | 5 ++--- 3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in index d938aac052e..7a78f4e854e 100644 --- a/dlls/winepulse.drv/Makefile.in +++ b/dlls/winepulse.drv/Makefile.in @@ -6,5 +6,4 @@ UNIX_CFLAGS = $(PULSE_CFLAGS)
C_SRCS = \ mmdevdrv.c \ - mult.c \ pulse.c diff --git a/dlls/winepulse.drv/mult.c b/dlls/winepulse.drv/mult.h similarity index 99% rename from dlls/winepulse.drv/mult.c rename to dlls/winepulse.drv/mult.h index 26b5e83c9ca..58f516a0d4d 100644 --- a/dlls/winepulse.drv/mult.c +++ b/dlls/winepulse.drv/mult.h @@ -20,11 +20,6 @@
#include <windef.h>
-#if 0 -#pragma makedep unix -#endif - - /********************************************************************** * A-law and u-law sample manipulation functions * Multiply with the given volume (vol must be between 0...1 inclusive) @@ -32,7 +27,7 @@ * These were taken from PulseAudio's sources but adjusted to directly * fit our usage (since we use floats directly) so they should be exact. */ -UINT8 mult_alaw_sample(UINT8 sample, float vol) +static UINT8 mult_alaw_sample(UINT8 sample, float vol) { static const float decode_to_13bits_float[1 << 8] = { @@ -708,7 +703,7 @@ UINT8 mult_alaw_sample(UINT8 sample, float vol) return encode[(int)(vol * decode_to_13bits_float[sample]) + ARRAY_SIZE(encode) / 2]; }
-UINT8 mult_ulaw_sample(UINT8 sample, float vol) +static UINT8 mult_ulaw_sample(UINT8 sample, float vol) { static const float decode_to_14bits_float[1 << 8] = { diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 41d988e692b..9446feb452c 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -44,6 +44,8 @@
#include "../mmdevapi/unixlib.h"
+#include "mult.h" + WINE_DEFAULT_DEBUG_CHANNEL(pulse);
enum phys_device_bus_type { @@ -117,9 +119,6 @@ static const REFERENCE_TIME DefaultPeriod = 100000; static pthread_mutex_t pulse_mutex; static pthread_cond_t pulse_cond = PTHREAD_COND_INITIALIZER;
-UINT8 mult_alaw_sample(UINT8, float); -UINT8 mult_ulaw_sample(UINT8, float); - static void pulse_lock(void) { pthread_mutex_lock(&pulse_mutex);