changeset 403:b2d233cd01ba

Add more debugging output.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 01 Jun 2006 22:39:02 +0000
parents f997b79a7251
children c556999b4994
files src/xmms-sid.c
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmms-sid.c	Thu Jun 01 02:18:02 2006 +0000
+++ b/src/xmms-sid.c	Thu Jun 01 22:39:02 2006 +0000
@@ -407,6 +407,9 @@
 
 
 		/* Open the audio output */
+		XSDEBUG("open audio output (%d, %d, %d)\n",
+			myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels);
+		
 		if (!xs_plugin_ip.output->
 		    open_audio(myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels)) {
 			xs_error("Couldn't open XMMS audio output (fmt=%x, freq=%i, nchan=%i)!\n", myStatus.audioFormat,
@@ -421,6 +424,7 @@
 		audioOpen = TRUE;
 
 		/* Set song information for current subtune */
+		XSDEBUG("set tune info\n");
 		xs_plugin_ip.set_info(myTune->subTunes[myStatus.currSong-1].tuneTitle,
 			(songLength > 0) ? (songLength * 1000) : 0,
 			(myTune->subTunes[myStatus.currSong-1].tuneSpeed > 0) ?
@@ -495,6 +499,7 @@
 			XSDEBUG("close audio #1\n");
 			xs_plugin_ip.output->close_audio();
 			audioOpen = FALSE;
+			XSDEBUG("closed\n");
 		}
 
 		/* Now determine if we continue by selecting other subtune or something */
@@ -503,10 +508,13 @@
 	}
 
 xs_err_exit:
+	XSDEBUG("out of playing loop\n");
+	
 	/* Close audio output plugin */
 	if (audioOpen) {
 		XSDEBUG("close audio #2\n");
 		xs_plugin_ip.output->close_audio();
+		XSDEBUG("closed\n");
 	}
 
 	g_free(audioBuffer);
@@ -585,7 +593,7 @@
  */
 void xs_stop(void)
 {
-	XSDEBUG("STOP_REQ\n");
+	XSDEBUG("stop requested\n");
 
 	/* Close the sub-tune control window, if any */
 	xs_subctrl_close();
@@ -593,7 +601,6 @@
 	/* Lock xs_status and stop playing thread */
 	XS_MUTEX_LOCK(xs_status);
 	if (xs_status.isPlaying) {
-		/* Stop playing */
 		XSDEBUG("stopping...\n");
 		xs_status.isPlaying = FALSE;
 		XS_MUTEX_UNLOCK(xs_status);
@@ -602,15 +609,20 @@
 		XS_MUTEX_UNLOCK(xs_status);
 	}
 
+	XSDEBUG("done, updating status\n");
+	
 	/* Status is now stopped, update the sub-tune
 	 * controller in fileinfo window (if open)
 	 */
 	xs_fileinfo_update();
 
 	/* Free tune information */
+	XS_MUTEX_LOCK(xs_status);
 	xs_status.sidPlayer->plrDeleteSID(&xs_status);
 	xs_tuneinfo_free(xs_status.tuneInfo);
 	xs_status.tuneInfo = NULL;
+	XS_MUTEX_UNLOCK(xs_status);
+	XSDEBUG("ok\n");
 }