osx_write: Make it compile on Snow Leopard.
[paraslash.git] / osx_write.c
index df10221feee218a8f8c5ebe012de724b9228b624..c40428895ece1e8376cd6e58b83a2369eba53fa4 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <sys/types.h>
 #include <dirent.h>
-#include <CoreAudio/CoreAudio.h>
+
 #include "para.h"
 #include "fd.h"
 #include "string.h"
 #include "osx_write.cmdline.h"
 #include "error.h"
 
-
-#include <CoreAudio/CoreAudio.h>
+#include <CoreServices/CoreServices.h>
 #include <AudioUnit/AudioUnit.h>
-#include <AudioToolbox/DefaultAudioOutput.h>
+#include <AudioToolbox/AudioToolbox.h>
 
 /** describes one input buffer for the osx writer */
 struct osx_buffer {
@@ -82,7 +81,7 @@ static void init_buffers(struct writer_node *wn)
 
        ptrptr = &powd->to;
        for (i = 0; i < conf->numbuffers_arg; i++) {
-               *ptrptr = malloc(sizeof(struct osx_buffer));
+               *ptrptr = para_malloc(sizeof(struct osx_buffer));
                (*ptrptr)->size = 0;
                (*ptrptr)->remaining = 0;
                (*ptrptr)->buffer = NULL;
@@ -279,7 +278,7 @@ static int osx_write_post_select(__a_unused struct sched *s,
 {
        struct private_osx_write_data *powd = wn->private_data;
        struct writer_node_group *wng = wn->wng;
-       short *data = (short*)wng->buf;
+       short *data = (short*)*wng->bufp;
 
        if (!need_new_buffer(wn))
                return 1;