summaryrefslogtreecommitdiffstats
path: root/channels/audin/client/oss/audin_oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/audin/client/oss/audin_oss.c')
-rw-r--r--channels/audin/client/oss/audin_oss.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c
index 979a800..c42c089 100644
--- a/channels/audin/client/oss/audin_oss.c
+++ b/channels/audin/client/oss/audin_oss.c
@@ -37,11 +37,7 @@
#include <libgen.h>
#include <limits.h>
#include <unistd.h>
-#if defined(__OpenBSD__)
-#include <soundcard.h>
-#else
-#include <sys/soundcard.h>
-#endif
+#include <oss-includes.h>
#include <sys/ioctl.h>
#include <freerdp/freerdp.h>
@@ -67,15 +63,15 @@ typedef struct
rdpContext* rdpcontext;
} AudinOSSDevice;
-#define OSS_LOG_ERR(_text, _error) \
- do \
- { \
- if (_error != 0) \
- { \
- char buffer[256] = { 0 }; \
- WLog_ERR(TAG, "%s: %i - %s\n", _text, _error, \
- winpr_strerror(_error, buffer, sizeof(buffer))); \
- } \
+#define OSS_LOG_ERR(_text, _error) \
+ do \
+ { \
+ if ((_error) != 0) \
+ { \
+ char buffer[256] = { 0 }; \
+ WLog_ERR(TAG, "%s: %i - %s\n", (_text), (_error), \
+ winpr_strerror((_error), buffer, sizeof(buffer))); \
+ } \
} while (0)
static UINT32 audin_oss_get_format(const AUDIO_FORMAT* format)
@@ -233,7 +229,8 @@ static DWORD WINAPI audin_oss_thread_func(LPVOID arg)
if (ioctl(pcm_handle, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1)
OSS_LOG_ERR("SNDCTL_DSP_SETFRAGMENT failed", errno);
- buffer_size = (oss->FramesPerPacket * oss->format.nChannels * (oss->format.wBitsPerSample / 8));
+ buffer_size =
+ (1ull * oss->FramesPerPacket * oss->format.nChannels * (oss->format.wBitsPerSample / 8ull));
buffer = (BYTE*)calloc((buffer_size + sizeof(void*)), sizeof(BYTE));
if (NULL == buffer)