Permalink
Browse files

Merge pull request #438 from Gillou68310/audio-sles

Some fixes for the audio sles plugin
  • Loading branch information...
Gillou68310 committed May 27, 2015
2 parents 498a1e5 + a322cee commit 0890230695ecce0ae6d408a2fedc76de3763d139
Showing with 8 additions and 5 deletions.
  1. +8 −5 jni/mupen64plus-audio-sles/main.c
@@ -195,22 +195,24 @@ static void DebugMessage(int level, const char *message, ...)
void queueCallback(SLAndroidSimpleBufferQueueItf caller, void *context)
{
threadLock *plock = (threadLock *) context;
-
+
pthread_mutex_lock(&(plock->mutex));
- if(plock->value == 0)
- pthread_cond_signal(&(plock->cond));
-
if(plock->value < plock->limit)
plock->value++;
+ pthread_cond_signal(&(plock->cond));
+
pthread_mutex_unlock(&(plock->mutex));
}
static void CloseAudio(void)
{
int i = 0;
-
+
+ primaryBufferPos = 0;
+ secondaryBufferIndex = 0;
+
/* Delete Primary buffer */
if (primaryBuffer != NULL)
{
@@ -230,6 +232,7 @@ static void CloseAudio(void)
secondaryBuffers[i] = NULL;
}
}
+ secondaryBufferBytes = 0;
free(secondaryBuffers);
secondaryBuffers = NULL;
}

0 comments on commit 0890230

Please sign in to comment.