# HG changeset patch # User Matti Hamalainen # Date 1065363724 0 # Node ID f9063960f04ed8204cbc94ef09da41e48cd34fc7 # Parent edec1818cf480e93ba7625488c90facbef1b18b7 Fixed sub-song changing diff -r edec1818cf48 -r f9063960f04e src/xmms-sid.c --- 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 */