summary refs log tree commit diff stats
path: root/audio/ossaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/ossaudio.c')
-rw-r--r--audio/ossaudio.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 9fefaa3a27..6bf8cc40c2 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -21,20 +21,32 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-
-/* Temporary kludge */
-#if defined __linux__ || (defined _BSD && !defined __APPLE__)
-#include <assert.h>
-#include "vl.h"
-
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/soundcard.h>
+#include <assert.h>
+#include "vl.h"
+
+#include "audio/audio_int.h"
+
+typedef struct OSSVoice {
+    HWVoice hw;
+    void *pcm_buf;
+    int fd;
+    int nfrags;
+    int fragsize;
+    int mmapped;
+    int old_optr;
+} OSSVoice;
 
-#define AUDIO_CAP "oss"
-#include "audio/audio.h"
-#include "audio/ossaudio.h"
+
+#define dolog(...) AUD_log ("oss", __VA_ARGS__)
+#ifdef DEBUG
+#define ldebug(...) dolog (__VA_ARGS__)
+#else
+#define ldebug(...)
+#endif
 
 #define QC_OSS_FRAGSIZE "QEMU_OSS_FRAGSIZE"
 #define QC_OSS_NFRAGS   "QEMU_OSS_NFRAGS"
@@ -463,4 +475,3 @@ struct audio_output_driver oss_output_driver = {
     INT_MAX,
     sizeof (OSSVoice)
 };
-#endif