]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - osx_write.c
client: Fix a memory leak in client_post_select().
[paraslash.git] / osx_write.c
index df10221feee218a8f8c5ebe012de724b9228b624..97a7ccf49ba74977718e335f15142306e11c2c91 100644 (file)
  * <skortze@sourceforge.net>
  */
 
+#include <regex.h>
 #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 +82,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 +279,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;