aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/oss.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-27 08:14:13 -0700
committerChris Robinson <[email protected]>2013-10-27 08:14:13 -0700
commit8ceb800defbf13354866cd7c6a4b676cf54aad5d (patch)
treee46b00b1fe38403173b28566cbcb2d421a4d9ca9 /Alc/backends/oss.c
parentb9e30f76041a029e9d4cd58f6c87086c0b527d6d (diff)
Rework threading functions
Diffstat (limited to 'Alc/backends/oss.c')
-rw-r--r--Alc/backends/oss.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c
index 892e2327..35ae80cc 100644
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -33,6 +33,7 @@
#include "alMain.h"
#include "alu.h"
+#include "threads.h"
#include <sys/soundcard.h>
@@ -54,14 +55,15 @@ static const char *oss_capture = "/dev/dsp";
typedef struct {
int fd;
- volatile int killNow;
- ALvoid *thread;
ALubyte *mix_data;
int data_size;
RingBuffer *ring;
int doCapture;
+
+ volatile int killNow;
+ althread_t thread;
} oss_data;
@@ -286,8 +288,7 @@ static ALCboolean oss_start_playback(ALCdevice *device)
data->data_size = device->UpdateSize * FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
data->mix_data = calloc(1, data->data_size);
- data->thread = StartThread(OSSProc, device);
- if(data->thread == NULL)
+ if(!StartThread(&data->thread, OSSProc, device))
{
free(data->mix_data);
data->mix_data = NULL;
@@ -428,8 +429,7 @@ static ALCenum oss_open_capture(ALCdevice *device, const ALCchar *deviceName)
data->mix_data = calloc(1, data->data_size);
device->ExtraData = data;
- data->thread = StartThread(OSSCaptureProc, device);
- if(data->thread == NULL)
+ if(!StartThread(&data->thread, OSSCaptureProc, device))
{
device->ExtraData = NULL;
free(data->mix_data);