changeset 91:f9063960f04e

Fixed sub-song changing
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 05 Oct 2003 14:22:04 +0000
parents edec1818cf48
children 2607683bc9eb
files src/xmms-sid.c
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmms-sid.c	Sun Oct 05 14:22:03 2003 +0000
+++ b/src/xmms-sid.c	Sun Oct 05 14:22:04 2003 +0000
@@ -250,7 +250,7 @@
  t_xs_status myStatus;
  t_xs_tune *myTune;
  gboolean audioOpen, doPlay;
- gint mySong, audioFreq, audioChannels, songLength, audioFmt;
+ gint audioFreq, audioChannels, songLength, audioFmt;
  gchar audioBuffer[XS_BUFSIZE];
 
  /* Initialize */
@@ -277,27 +277,27 @@
  while (xs_status.isPlaying && doPlay)
  {
  pthread_mutex_lock(&xs_mutex);
- mySong = xs_status.currSong;
- songLength = myTune->subTunes[mySong - 1].tuneLength;
+ myStatus.currSong = xs_status.currSong;
+ songLength = myTune->subTunes[myStatus.currSong - 1].tuneLength;
  pthread_mutex_unlock(&xs_mutex);
 
- XSDEBUG("subtune #%i selected, initializing...\n", mySong);
+ XSDEBUG("subtune #%i selected, initializing...\n", myStatus.currSong);
 
 
  /* Initialize song */
  if (!xs_player->plrInitSong(&myStatus))
 	{
 	XSERR("Couldn't initialize SID-tune '%s' (sub-tune #%i)!\n",
-		myTune->tuneFilename, mySong);
+		myTune->tuneFilename, myStatus.currSong);
 	goto err_exit;
 	}
 
 
  /* Get song information for current subtune */
  xs_plugin_ip.set_info(
- 	myTune->subTunes[mySong - 1].tuneTitle,
+ 	myTune->subTunes[myStatus.currSong - 1].tuneTitle,
  	(songLength > 0) ? (songLength * 1000) : -1,
- 	(myTune->subTunes[mySong - 1].tuneSpeed > 0) ? (myTune->subTunes[mySong - 1].tuneSpeed * 1000) : -1,
+ 	(myTune->subTunes[myStatus.currSong - 1].tuneSpeed > 0) ? (myTune->subTunes[myStatus.currSong - 1].tuneSpeed * 1000) : -1,
 	audioFreq,
 	audioChannels);
 
@@ -317,7 +317,7 @@
  /*
   * Play the subtune
   */
- while (xs_status.isPlaying && myStatus.isPlaying && (xs_status.currSong == mySong))
+ while (xs_status.isPlaying && myStatus.isPlaying && (xs_status.currSong == myStatus.currSong))
 	{
 	/* Render audio data */
 	xs_player->plrFillBuffer(&myStatus, audioBuffer, XS_BUFSIZE);
@@ -329,12 +329,12 @@
 
 	/* Wait a little */
 	while (xs_status.isPlaying &&
-		(xs_status.currSong == mySong) &&
+		(xs_status.currSong == myStatus.currSong) &&
 		(xs_plugin_ip.output->buffer_free() < XS_BUFSIZE))
 		xmms_usleep(10000);
 
 	/* Output audio */
-	if (xs_status.isPlaying && (xs_status.currSong == mySong))
+	if (xs_status.isPlaying && (xs_status.currSong == myStatus.currSong))
 		xs_plugin_ip.output->write_audio(audioBuffer, XS_BUFSIZE);
 
 	/* Check if we have played enough */