示例#1
0
static inline int32_t * samples_get_rdbuf(void)
{
    ci->semaphore_wait(&sample_queue.emu_sem_head);

    if (ci->stop_codec || ci->new_track)
    {
        /* Told to stop. Buffer must be released. */
        samples_release_rdbuf();
        return NULL;
    }

    return sample_queue.wav_chunk[sample_queue.head & WAV_CHUNK_MASK].audio;
}
示例#2
0
文件: spc.c 项目: Rockbox/rockbox
static intptr_t emu_thread_send_msg(long id, intptr_t data)
{
    struct sample_queue_chunk *chunk;
    /* Grab an audio output buffer */
    ci->semaphore_wait(&sample_queue.emu_sem_head, TIMEOUT_BLOCK);
    chunk = &sample_queue.wav_chunk[sample_queue.head & WAV_CHUNK_MASK];
    /* Place a message in it instead of audio */
    chunk->id = id;
    chunk->data = data;
    /* Release it to the emu thread */
    samples_release_rdbuf();

    if (id != SPC_EMU_QUIT) {
        /* Wait for a response */
        ci->semaphore_wait(&sample_queue.emu_evt_reply, TIMEOUT_BLOCK);
    }

    return sample_queue.retval;    
}