diff options
author | Max Kellermann <max@duempel.org> | 2008-04-12 04:19:50 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-04-12 04:19:50 +0000 |
commit | 14529af732703dc0706be7db87a5292d0d122e77 (patch) | |
tree | 33ec5be670e8c8ea3e29546072be3923742a4eed /src | |
parent | 66f1d1ddb356ca69a6a0e738d2afde9c65459bd2 (diff) | |
download | mpd-14529af732703dc0706be7db87a5292d0d122e77.tar.gz mpd-14529af732703dc0706be7db87a5292d0d122e77.tar.xz mpd-14529af732703dc0706be7db87a5292d0d122e77.zip |
pass dc to decoder_task()
git-svn-id: https://svn.musicpd.org/mpd/trunk@7323 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/decode.c | 8 | ||||
-rw-r--r-- | src/decode.h | 2 | ||||
-rw-r--r-- | src/main.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/decode.c b/src/decode.c index 023dbaaac..4ed0b6151 100644 --- a/src/decode.c +++ b/src/decode.c @@ -323,11 +323,11 @@ stop_no_close: dc->stop = 0; } -static void * decoder_task(mpd_unused void *unused) +static void * decoder_task(void *arg) { + DecoderControl *dc = arg; OutputBuffer *cb = &(getPlayerData()->buffer); PlayerControl *pc = &(getPlayerData()->playerControl); - DecoderControl * dc = &(getPlayerData()->decoderControl); notifyEnter(&dc->notify); @@ -344,14 +344,14 @@ static void * decoder_task(mpd_unused void *unused) } } -void decoderInit(void) +void decoderInit(DecoderControl * dc) { pthread_attr_t attr; pthread_t decoder_thread; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if (pthread_create(&decoder_thread, &attr, decoder_task, NULL)) + if (pthread_create(&decoder_thread, &attr, decoder_task, dc)) FATAL("Failed to spawn decoder task: %s\n", strerror(errno)); } diff --git a/src/decode.h b/src/decode.h index 32da5ec3d..84aa8efb4 100644 --- a/src/decode.h +++ b/src/decode.h @@ -57,6 +57,6 @@ void decoder_wakeup_player(void); void decoder_sleep(DecoderControl * dc); -void decoderInit(void); +void decoderInit(DecoderControl * dc); #endif diff --git a/src/main.c b/src/main.c index d20a187d4..d3cc35924 100644 --- a/src/main.c +++ b/src/main.c @@ -443,7 +443,7 @@ int main(int argc, char *argv[]) initZeroconf(); openVolumeDevice(); - decoderInit(); + decoderInit(&getPlayerData()->decoderControl); playerInit(&getPlayerData()->playerControl); read_state_file(); |