changeset 1355:0428dcce1d45

Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author William Pitcock <nenolod@atheme-project.org>
date Mon, 23 Jul 2007 17:55:01 -0500
parents b670d1f3c2e4 (current diff) 1e36cc6c4b23 (diff)
children 996430ebc1c8
files
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/cdaudio-ng/cdaudio-ng.c	Mon Jul 23 17:54:54 2007 -0500
+++ b/src/cdaudio-ng/cdaudio-ng.c	Mon Jul 23 17:55:01 2007 -0500
@@ -67,7 +67,7 @@
 static TitleInput		*cdaudio_get_song_tuple(gchar *filename);
 
 static TitleInput		*create_tuple_from_trackinfo(char *filename);
-static void				*dae_playing_thread_core(dae_params_t *pdae_params);
+static void				dae_play_loop(dae_params_t *pdae_params);
 static int				calculate_track_length(int startlsn, int endlsn);
 static int				find_trackno_from_filename(char *filename);
 static void				cleanup_on_error();
@@ -476,15 +476,18 @@
 			return;
 		}
 
+		/*
 		if (debug)
 			printf("cdaudio-ng: starting dae thread...\n");
+		*/
 		pdae_params = (dae_params_t *) malloc(sizeof(dae_params_t));
 		pdae_params->startlsn = trackinfo[trackno].startlsn;
 		pdae_params->endlsn = trackinfo[trackno].endlsn;
 		pdae_params->pplayback = pinputplayback;
 		pdae_params->seektime = -1;
 		pdae_params->currlsn = trackinfo[trackno].startlsn;
-		pdae_params->thread = g_thread_create((GThreadFunc) dae_playing_thread_core, pdae_params, TRUE, NULL);
+		pdae_params->thread = g_thread_self();
+		dae_play_loop(pdae_params);
 	}
 	else {
 		if (debug)
@@ -741,12 +744,12 @@
 	return tuple;
 }
 
-void *dae_playing_thread_core(dae_params_t *pdae_params)
+void dae_play_loop(dae_params_t *pdae_params)
 {
 	unsigned char *buffer = (unsigned char *) malloc(CDDA_DAE_FRAMES * CDIO_CD_FRAMESIZE_RAW);
 
 	if (debug)
-		printf("cdaudio-ng: dae thread started\n");
+		printf("cdaudio-ng: dae started\n");
 	cdio_lseek(pcdio, pdae_params->startlsn * CDIO_CD_FRAMESIZE_RAW, SEEK_SET);
 
 	gboolean output_paused = FALSE;
@@ -818,7 +821,7 @@
 		pdae_params->currlsn += lsncount;
 	}
 	if (debug)
-		printf("cdaudio-ng: dae thread ended\n");
+		printf("cdaudio-ng: dae ended\n");
 
 	pdae_params->pplayback->playing = FALSE;
 	pdae_params->pplayback->output->close_audio();
@@ -826,9 +829,6 @@
 
 	pdae_params->pplayback->output->close_audio();
 	free(buffer);
-
-	g_thread_exit(NULL);
-	return NULL;
 }
 
 int calculate_track_length(int startlsn, int endlsn)