Exemplo n.º 1
0
static void ALCwinmmCapture_Destruct(ALCwinmmCapture *self)
{
    void *buffer = NULL;
    int i;

    /* Tell the processing thread to quit and wait for it to do so. */
    if(!ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel))
    {
        PostThreadMessage(self->thread, WM_QUIT, 0, 0);

        althrd_join(self->thread, &i);

        /* Make sure capture is stopped and all pending buffers are flushed. */
        waveInReset(self->InHdl);

        // Release the wave buffers
        for(i = 0;i < 4;i++)
        {
            waveInUnprepareHeader(self->InHdl, &self->WaveBuffer[i], sizeof(WAVEHDR));
            if(i == 0) buffer = self->WaveBuffer[i].lpData;
            self->WaveBuffer[i].lpData = NULL;
        }
        free(buffer);
    }

    ll_ringbuffer_free(self->Ring);
    self->Ring = NULL;

    // Close the Wave device
    if(self->InHdl)
        waveInClose(self->InHdl);
    self->InHdl = 0;

    ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
}
Exemplo n.º 2
0
static void ALCwinmmPlayback_Destruct(ALCwinmmPlayback *self)
{
    if(self->OutHdl)
        waveOutClose(self->OutHdl);
    self->OutHdl = 0;

    ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
}
Exemplo n.º 3
0
static void ALCsolarisBackend_Destruct(ALCsolarisBackend *self)
{
    if(self->fd != -1)
        close(self->fd);
    self->fd = -1;

    free(self->mix_data);
    self->mix_data = NULL;
    self->data_size = 0;

    ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
}
Exemplo n.º 4
0
Arquivo: opensl.c Projeto: dns/CLove
static void ALCopenslPlayback_Destruct(ALCopenslPlayback* self)
{
    if(self->mBufferQueueObj != NULL)
        VCALL0(self->mBufferQueueObj,Destroy)();
    self->mBufferQueueObj = NULL;

    if(self->mOutputMix != NULL)
        VCALL0(self->mOutputMix,Destroy)();
    self->mOutputMix = NULL;

    if(self->mEngineObj != NULL)
        VCALL0(self->mEngineObj,Destroy)();
    self->mEngineObj = NULL;
    self->mEngine = NULL;

    ll_ringbuffer_free(self->mRing);
    self->mRing = NULL;

    alcnd_destroy(&self->mCond);

    ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
}