diff options
author | Max Kellermann <max@duempel.org> | 2008-11-04 11:19:37 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-04 11:19:37 +0100 |
commit | 37696dcbbf5f1fbe901de269742218ae15b756a4 (patch) | |
tree | 47cfd0e3397e169cbed47ab5f5447e48d379a2e4 /src/output/osx_plugin.c | |
parent | 792711bddd3519c0e869e1853d1123861d928aa7 (diff) | |
download | mpd-37696dcbbf5f1fbe901de269742218ae15b756a4.tar.gz mpd-37696dcbbf5f1fbe901de269742218ae15b756a4.tar.xz mpd-37696dcbbf5f1fbe901de269742218ae15b756a4.zip |
osx: adapt to new output plugin API
The OS X output plugin wasn't adapted to the new output plugin yet,
because I had no Mac to test...
Diffstat (limited to 'src/output/osx_plugin.c')
-rw-r--r-- | src/output/osx_plugin.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index a31a6e736..5fbfc7c09 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -77,15 +77,12 @@ static bool osx_testDefault() return true; } -static int osx_initDriver(struct audio_output *audioOutput, - mpd_unused const struct audio_format *audio_format, - ConfigParam * param) +static void * +osx_initDriver(mpd_unused struct audio_output *audioOutput, + mpd_unused const struct audio_format *audio_format, + mpd_unused ConfigParam * param) { - OsxData *od = newOsxData(); - - audioOutput->data = od; - - return 0; + return newOsxData(); } static void freeOsxData(OsxData * od) @@ -97,24 +94,24 @@ static void freeOsxData(OsxData * od) free(od); } -static void osx_finishDriver(struct audio_output *audioOutput) +static void osx_finishDriver(void *data) { - OsxData *od = (OsxData *) audioOutput->data; + OsxData *od = data; freeOsxData(od); } -static void osx_dropBufferedAudio(struct audio_output *audioOutput) +static void osx_dropBufferedAudio(void *data) { - OsxData *od = (OsxData *) audioOutput->data; + OsxData *od = data; pthread_mutex_lock(&od->mutex); od->len = 0; pthread_mutex_unlock(&od->mutex); } -static void osx_closeDevice(struct audio_output *audioOutput) +static void osx_closeDevice(void *data) { - OsxData *od = (OsxData *) audioOutput->data; + OsxData *od = data; pthread_mutex_lock(&od->mutex); while (od->len) { @@ -213,10 +210,9 @@ static OSStatus osx_render(void *vdata, } static bool -osx_openDevice(struct audio_output *audioOutput, - struct audio_format *audioFormat) +osx_openDevice(void *data, struct audio_format *audioFormat) { - OsxData *od = (OsxData *) audioOutput->data; + OsxData *od = data; ComponentDescription desc; Component comp; AURenderCallbackStruct callback; @@ -291,9 +287,9 @@ osx_openDevice(struct audio_output *audioOutput, } static bool -osx_play(struct audio_output *audioOutput, const char *playChunk, size_t size) +osx_play(void *data, const char *playChunk, size_t size) { - OsxData *od = (OsxData *) audioOutput->data; + OsxData *od = data; size_t bytesToCopy; size_t curpos; |