Diff between 375850c4f2b50e35efe6d37d06518dcfbcece0b3 and 8a16d7064583cd94686aca52b1b5cc393369bd9b

Changed Files

File Additions Deletions Status
android/client/if-audio.c +6 -12 modified

Full Patch

diff --git a/android/client/if-audio.c b/android/client/if-audio.c
index ce9e534..9921b30 100644
--- a/android/client/if-audio.c
+++ b/android/client/if-audio.c
@@ -116,15 +116,6 @@ static void init_p(int argc, const char **argv)
 	if_audio = device;
 }
 
-static void playthread_cleanup(void *arg)
-{
-	pthread_mutex_lock(&state_mutex);
-	current_state = STATE_STOPPED;
-	pthread_mutex_unlock(&state_mutex);
-
-	haltest_info("Done playing.\n");
-}
-
 static int feed_from_file(short *buffer, void *data)
 {
 	FILE *in = data;
@@ -185,8 +176,6 @@ static void *playback_thread(void *data)
 	void *cb_data = NULL;
 	float freq = 440.0;
 
-	pthread_cleanup_push(playthread_cleanup, NULL);
-
 	/* Use file or fall back to generator */
 	if (in) {
 		filbuff_cb = feed_from_file;
@@ -228,7 +217,12 @@ static void *playback_thread(void *data)
 	if (in)
 		fclose(in);
 
-	pthread_cleanup_pop(1);
+	pthread_mutex_lock(&state_mutex);
+	current_state = STATE_STOPPED;
+	pthread_mutex_unlock(&state_mutex);
+
+	haltest_info("Done playing.\n");
+
 	return NULL;
 }