From: <sag...@us...> - 2014-02-20 20:15:41
|
Revision: 3741 http://sourceforge.net/p/modplug/code/3741 Author: saga-games Date: 2014-02-20 20:15:33 +0000 (Thu, 20 Feb 2014) Log Message: ----------- [Imp] libopenmpt & OpenMPT render export: When exporting an XM file with an F00 command, stop processing as soon as no more voices are playing. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2014-02-20 17:46:45 UTC (rev 3740) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2014-02-20 20:15:33 UTC (rev 3741) @@ -31,6 +31,7 @@ static CSoundFile::samplecount_t ReadInterleaved(CSoundFile &sndFile, void *outputBuffer, CSoundFile::samplecount_t count, SampleFormat sampleFormat, Dither &dither) //------------------------------------------------------------------------------------------------------------------------------------------------------------------- { + sndFile.ResetMixStat(); switch(sampleFormat.value) { case SampleFormatUnsigned8: Modified: trunk/OpenMPT/soundlib/Fastmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp 2014-02-20 17:46:45 UTC (rev 3740) +++ trunk/OpenMPT/soundlib/Fastmix.cpp 2014-02-20 20:15:33 UTC (rev 3741) @@ -277,7 +277,7 @@ StereoFill(MixSoundBuffer, count, gnDryROfsVol, gnDryLOfsVol); if(m_MixerSettings.gnChannels > 2) InitMixBuffer(MixRearBuffer, count*2); - CHANNELINDEX nchused = 0, nchmixed = 0; + CHANNELINDEX nchmixed = 0; const bool ITPingPongMode = IsITPingPongMode(); const bool realtimeMix = !IsRenderingToDisc(); @@ -334,7 +334,6 @@ } } } - nchused++; // Calculate offset of loop wrap-around buffer for this sample. const int8 * const samplePointer = static_cast<const int8 *>(chn.pCurrentSample); @@ -462,7 +461,7 @@ chn.pCurrentSample = samplePointer; nchmixed += naddmix; } - m_nMixStat = std::max<CHANNELINDEX>(m_nMixStat, nchused); + m_nMixStat = std::max<CHANNELINDEX>(m_nMixStat, nchmixed); } Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2014-02-20 17:46:45 UTC (rev 3740) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2014-02-20 20:15:33 UTC (rev 3741) @@ -184,6 +184,17 @@ m_PatternCuePoints.push_back(cue); } #endif + + #ifdef MODPLUG_TRACKER + if(IsRenderingToDisc()) + #endif // MODPLUG_TRACKER + { + // Stop playback on F00 if no more voices are active. + if(m_nMusicSpeed == uint16_max && m_nMixStat == 0 && GetType() == MOD_TYPE_XM) + { + m_SongFlags.set(SONG_ENDREACHED); + } + } } else { // no new pattern data #ifdef MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |