|
|
9d1de1 |
diff -ru libao-1.2.0.orig/src/ao_wmm.c libao-1.2.0/src/ao_wmm.c
|
|
|
9d1de1 |
--- libao-1.2.0.orig/src/ao_wmm.c 2012-02-14 00:46:06.000000000 +0000
|
|
|
9d1de1 |
+++ libao-1.2.0/src/ao_wmm.c 2022-08-26 14:17:15.193852800 +0000
|
|
|
9d1de1 |
@@ -31,9 +31,7 @@
|
|
|
9d1de1 |
#define _CRT_SECURE_NO_DEPRECATE
|
|
|
9d1de1 |
|
|
|
9d1de1 |
#include <windows.h>
|
|
|
9d1de1 |
-#include <mmreg.h>
|
|
|
9d1de1 |
#include <mmsystem.h>
|
|
|
9d1de1 |
-#include <ksmedia.h>
|
|
|
9d1de1 |
|
|
|
9d1de1 |
#include <stdlib.h>
|
|
|
9d1de1 |
#include <string.h>
|
|
|
9d1de1 |
@@ -41,6 +39,47 @@
|
|
|
9d1de1 |
#include <stdarg.h>
|
|
|
9d1de1 |
#include <stdio.h>
|
|
|
9d1de1 |
|
|
|
9d1de1 |
+#define waveOutGetErrorText waveOutGetErrorTextA
|
|
|
9d1de1 |
+#define waveOutGetDevCaps waveOutGetDevCapsA
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
+#ifndef WAVE_MAPPER
|
|
|
9d1de1 |
+#define WAVE_MAPPER ((unsigned int)-1)
|
|
|
9d1de1 |
+#endif
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
+#ifndef WAVE_FORMAT_EXTENSIBLE
|
|
|
9d1de1 |
+#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
|
|
|
9d1de1 |
+#endif
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
+#ifndef WAVE_ALLOWSYNC
|
|
|
9d1de1 |
+#define WAVE_ALLOWSYNC 0x0002
|
|
|
9d1de1 |
+#endif
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
+#ifndef CALLBACK_NULL
|
|
|
9d1de1 |
+#define CALLBACK_NULL (unsigned int)(0x00000000)
|
|
|
9d1de1 |
+#endif
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
+typedef struct {
|
|
|
9d1de1 |
+ WAVEFORMATEX Format;
|
|
|
9d1de1 |
+ union {
|
|
|
9d1de1 |
+ WORD wValidBitsPerSample;
|
|
|
9d1de1 |
+ WORD wSamplesPerBlock;
|
|
|
9d1de1 |
+ WORD wReserved;
|
|
|
9d1de1 |
+ } Samples;
|
|
|
9d1de1 |
+ DWORD dwChannelMask;
|
|
|
9d1de1 |
+ GUID SubFormat;
|
|
|
9d1de1 |
+} WAVEFORMATEXTENSIBLE,*PWAVEFORMATEXTENSIBLE;
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
+typedef struct tagWAVEOUTCAPSA {
|
|
|
9d1de1 |
+ WORD wMid;
|
|
|
9d1de1 |
+ WORD wPid;
|
|
|
9d1de1 |
+ UINT vDriverVersion;
|
|
|
9d1de1 |
+ CHAR szPname[32];
|
|
|
9d1de1 |
+ DWORD dwFormats;
|
|
|
9d1de1 |
+ WORD wChannels;
|
|
|
9d1de1 |
+ WORD wReserved1;
|
|
|
9d1de1 |
+ DWORD dwSupport;
|
|
|
9d1de1 |
+} WAVEOUTCAPS;
|
|
|
9d1de1 |
+
|
|
|
9d1de1 |
#ifndef KSDATAFORMAT_SUBTYPE_PCM
|
|
|
9d1de1 |
#define KSDATAFORMAT_SUBTYPE_PCM (GUID) {0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}
|
|
|
9d1de1 |
#endif
|
|
|
9d1de1 |
@@ -339,7 +378,7 @@
|
|
|
9d1de1 |
unsigned int ms = (internal->msPerBlock>>1)+1;
|
|
|
9d1de1 |
if (wait_all) ms *= n;
|
|
|
9d1de1 |
adebug("sleep for %ums wait on %d blocks\n",ms, internal->sent_blocks);
|
|
|
9d1de1 |
- Sleep(ms);
|
|
|
9d1de1 |
+ usleep(ms * 1000);
|
|
|
9d1de1 |
}
|
|
|
9d1de1 |
}
|
|
|
9d1de1 |
|
|
|
9d1de1 |
@@ -558,7 +597,7 @@
|
|
|
9d1de1 |
const int idx = _ao_get_free_block(device);
|
|
|
9d1de1 |
|
|
|
9d1de1 |
if (idx == -1) {
|
|
|
9d1de1 |
- Sleep(internal->msPerBlock);
|
|
|
9d1de1 |
+ usleep(internal->msPerBlock * 1000);
|
|
|
9d1de1 |
continue;
|
|
|
9d1de1 |
}
|
|
|
9d1de1 |
|
|
|
9d1de1 |
@@ -572,7 +611,7 @@
|
|
|
9d1de1 |
}
|
|
|
9d1de1 |
|
|
|
9d1de1 |
/* Do copy */
|
|
|
9d1de1 |
- CopyMemory((char*)internal->wh[idx].wh.lpData
|
|
|
9d1de1 |
+ memcpy((char*)internal->wh[idx].wh.lpData
|
|
|
9d1de1 |
+ internal->wh[idx].count,
|
|
|
9d1de1 |
output_samples, n);
|
|
|
9d1de1 |
|