Beispiel #1
0
// close the android audio device
void android_CloseRecDevice(OPENSL_STREAM *p)
{
	DEBUG_DVC("p=%p", p);

  if (p == NULL)
    return;

	if (p->queue)
	{
		while (Queue_Count(p->queue) > 0)
		{
			queue_element *e = Queue_Dequeue(p->queue);
			free(e->data);
			free(e);
		}
		Queue_Free(p->queue);
	}

	if (p->next)
	{
		free(p->next->data);
		free(p->next);
	}

	if (p->prep)
	{
		free(p->prep->data);
		free(p->prep);
	}

  openSLDestroyEngine(p);

  free(p);
}
Beispiel #2
0
// close the android audio device
void android_CloseAudioDevice(OPENSL_STREAM *p){

	if (p == NULL)
		return;

	openSLDestroyEngine(p);

	if(p->buffer) free(p->buffer);
	
	free(p);
}
Beispiel #3
0
// close the android audio device
void android_CloseAudioDevice(OPENSL_STREAM* p)
{
	if (p == NULL)
		return;

	openSLDestroyEngine(p);

	if (p->queue)
		Queue_Free(p->queue);

	free(p);
}
Beispiel #4
0
// close the android audio device
void android_CloseAudioDevice(OPENSL_STREAM *p) {

  if (p == NULL)
    return;

  openSLDestroyEngine(p);

  if (p->inlock != NULL) {
    notifyThreadLock(p->inlock);
    destroyThreadLock(p->inlock);
    p->inlock = NULL;
  }

  if (p->outlock != NULL) {
    notifyThreadLock(p->outlock);
    destroyThreadLock(p->outlock);
    p->inlock = NULL;
  }

  if (p->outputBuffer[0] != NULL) {
    free(p->outputBuffer[0]);
    p->outputBuffer[0] = NULL;
  }

  if (p->outputBuffer[1] != NULL) {
    free(p->outputBuffer[1]);
    p->outputBuffer[1] = NULL;
  }

  if (p->inputBuffer[0] != NULL) {
    free(p->inputBuffer[0]);
    p->inputBuffer[0] = NULL;
  }

  if (p->inputBuffer[1] != NULL) {
    free(p->inputBuffer[1]);
    p->inputBuffer[1] = NULL;
  }

  free(p);
}
Beispiel #5
0
// close the android audio device
void android_CloseAudioDevice(OPENSL_STREAM *p){

  if (p == NULL)
    return;

  openSLDestroyEngine(p);

  if (p->outputBuffer != NULL) {
    free(p->outputBuffer);
    p->outputBuffer= NULL;
  }

  if (p->playBuffer != NULL) {
    free(p->playBuffer);
    p->playBuffer = NULL;
  }

  free_circular_buffer(p->outrb);

  free(p);
}