From: Paul Brossier Date: Sun, 15 Jul 2012 20:54:38 +0000 (-0600) Subject: src/io/sink.c: implement X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=779966bd7d91e0ff09e26d8d2f8524791e72e5b4;p=aubio.git src/io/sink.c: implement --- diff --git a/src/io/sink.c b/src/io/sink.c index c4129d24..570f6742 100644 --- a/src/io/sink.c +++ b/src/io/sink.c @@ -44,13 +44,30 @@ aubio_sink_t * new_aubio_sink(char_t * uri, uint_t samplerate) { if (s->sink) return s; #endif /* HAVE_SNDFILE */ #endif /* __APPLE__ */ - if (s->sink == NULL) { AUBIO_FREE(s); return NULL; } + AUBIO_ERROR("failed opening %s", uri); + AUBIO_FREE(s); + return NULL; } void aubio_sink_do(aubio_sink_t * s, fvec_t * write_data, uint_t write) { +#ifdef __APPLE__ + aubio_sink_apple_audio_do((aubio_sink_apple_audio_t *)s->sink, write_data, write); +#else /* __APPLE__ */ +#if HAVE_SNDFILE + aubio_sink_sndfile_do((aubio_sink_sndfile_t *)s->sink, write_data, write); +#endif /* HAVE_SNDFILE */ +#endif /* __APPLE__ */ } void del_aubio_sink(aubio_sink_t * s) { + if (!s) return; +#ifdef __APPLE__ + del_aubio_sink_apple_audio((aubio_sink_apple_audio_t *)s->sink); +#else /* __APPLE__ */ +#if HAVE_SNDFILE + del_aubio_sink_sndfile((aubio_sink_sndfile_t *)s->sink); +#endif /* HAVE_SNDFILE */ +#endif /* __APPLE__ */ AUBIO_FREE(s); return; }