pass dc to decoder_task()
git-svn-id: https://svn.musicpd.org/mpd/trunk@7323 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
66f1d1ddb3
commit
14529af732
@ -323,11 +323,11 @@ stop_no_close:
|
|||||||
dc->stop = 0;
|
dc->stop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void * decoder_task(mpd_unused void *unused)
|
static void * decoder_task(void *arg)
|
||||||
{
|
{
|
||||||
|
DecoderControl *dc = arg;
|
||||||
OutputBuffer *cb = &(getPlayerData()->buffer);
|
OutputBuffer *cb = &(getPlayerData()->buffer);
|
||||||
PlayerControl *pc = &(getPlayerData()->playerControl);
|
PlayerControl *pc = &(getPlayerData()->playerControl);
|
||||||
DecoderControl * dc = &(getPlayerData()->decoderControl);
|
|
||||||
|
|
||||||
notifyEnter(&dc->notify);
|
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_attr_t attr;
|
||||||
pthread_t decoder_thread;
|
pthread_t decoder_thread;
|
||||||
|
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
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));
|
FATAL("Failed to spawn decoder task: %s\n", strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,6 @@ void decoder_wakeup_player(void);
|
|||||||
|
|
||||||
void decoder_sleep(DecoderControl * dc);
|
void decoder_sleep(DecoderControl * dc);
|
||||||
|
|
||||||
void decoderInit(void);
|
void decoderInit(DecoderControl * dc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -443,7 +443,7 @@ int main(int argc, char *argv[])
|
|||||||
initZeroconf();
|
initZeroconf();
|
||||||
|
|
||||||
openVolumeDevice();
|
openVolumeDevice();
|
||||||
decoderInit();
|
decoderInit(&getPlayerData()->decoderControl);
|
||||||
playerInit(&getPlayerData()->playerControl);
|
playerInit(&getPlayerData()->playerControl);
|
||||||
read_state_file();
|
read_state_file();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user