/*
    When CloseStream() is called, the multi-api layer ensures that
    the stream has already been stopped or aborted.
*/
static PaError CloseStream( PaStream* s )
{
    PaError result = paNoError;
    PaSkeletonStream *stream = (PaSkeletonStream*)s;

    /*
        IMPLEMENT ME:
            - additional stream closing + cleanup
    */

    PaUtil_TerminateBufferProcessor( &stream->bufferProcessor );
    PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation );
    PaUtil_FreeMemory( stream );

    return result;
}
Example #2
0
static PaError
CloseStream(PaStream *stream)
{
	PaSndioStream *s = (PaSndioStream *)stream;

	DPR("CloseStream:\n");

	if (!s->stopped)
		StopStream(stream);

	if (s->mode & SIO_REC)
		free(s->rbuf);
	if (s->mode & SIO_PLAY)
		free(s->wbuf);
	sio_close(s->hdl);
        PaUtil_TerminateStreamRepresentation(&s->base);
	PaUtil_TerminateBufferProcessor(&s->bufproc);
	PaUtil_FreeMemory(s);
	return paNoError;
}