fix broken semaphore usage in OS/2 DART driver. whitespace cleanups.

master
sezero 9 years ago committed by Claudio Matsuoka
parent 6961f816a6
commit 31033bd2f1
  1. 26
      src/sound_dart.c

@ -6,17 +6,11 @@
* file for more information. * file for more information.
*/ */
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
/* /*
This should work for OS/2 Dart * This should work for OS/2 Dart
* History:
History: * 1.0 - By Kevin Langman
1.0 - By Kevin Langman */
*/
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
#undef VERSION /* stop conflict with os2medef.h */ #undef VERSION /* stop conflict with os2medef.h */
@ -29,6 +23,7 @@
#include <fcntl.h> #include <fcntl.h>
#define INCL_DOS #define INCL_DOS
#define INCL_DOSERRORS
#include <os2.h> #include <os2.h>
#include <mcios2.h> #include <mcios2.h>
#include <meerror.h> #include <meerror.h>
@ -52,7 +47,7 @@ static short ready = 1;
static HMTX mutex; static HMTX mutex;
// Buffer update thread (created and called by DART) /* Buffer update thread (created and called by DART) */
static LONG APIENTRY OS2_Dart_UpdateBuffers static LONG APIENTRY OS2_Dart_UpdateBuffers
(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags) { (ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags) {
@ -83,16 +78,15 @@ static int init(struct options *options)
chkparm1("buffer", bsize = strtoul(token, NULL, 0)); chkparm1("buffer", bsize = strtoul(token, NULL, 0));
parm_end(); parm_end();
if (DosCreateMutexSem(NULL, &mutex, 0, 0) != NO_ERROR)
return -1;
if ((bsize < BUF_MIN || bsize > BUF_MAX) && bsize != 0) { if ((bsize < BUF_MIN || bsize > BUF_MAX) && bsize != 0) {
bsize = 16 * 1024; bsize = 16 * 1024;
} else { } else {
bsize *= 1024; bsize *= 1024;
} }
//if( sharing < 1 || sharing > 0 ){
// sharing = 0;
//}
MixBuffers[0].pBuffer = NULL; /* marker */ MixBuffers[0].pBuffer = NULL; /* marker */
memset(&GenericParms, 0, sizeof(MCI_GENERIC_PARMS)); memset(&GenericParms, 0, sizeof(MCI_GENERIC_PARMS));
@ -140,7 +134,7 @@ static int init(struct options *options)
if (bsize == 0) { if (bsize == 0) {
bsize = MixSetupParms.ulBufferSize; bsize = MixSetupParms.ulBufferSize;
} }
//printf( "Dart Buffer Size = %d\n", bsize ); /*printf("Dart Buffer Size = %d\n", bsize);*/
BufferParms.ulNumBuffers = BUFFERCOUNT; BufferParms.ulNumBuffers = BUFFERCOUNT;
BufferParms.ulBufferSize = bsize; BufferParms.ulBufferSize = bsize;

Loading…
Cancel
Save