From 894560da81dd47961dad69a4cda2ee75d839da2f Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 10 Sep 2010 18:37:27 +0000 Subject: crossfade plugin: fixed cutting off last track git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1884 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Effect/crossfade/crossfadeplugin.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/plugins/Effect/crossfade/crossfadeplugin.cpp') diff --git a/src/plugins/Effect/crossfade/crossfadeplugin.cpp b/src/plugins/Effect/crossfade/crossfadeplugin.cpp index b937dd51b..a50df9b2b 100644 --- a/src/plugins/Effect/crossfade/crossfadeplugin.cpp +++ b/src/plugins/Effect/crossfade/crossfadeplugin.cpp @@ -50,9 +50,15 @@ void CrossfadePlugin::applyEffect(Buffer *b) if(m_core->totalTime() - m_handler->elapsed() < m_overlap + 2000) { StateHandler::instance()->sendNextTrackRequest(); - m_state = PREPARING; + m_state = CHECKING; } return; + case CHECKING: + //next source has been received and current engine will be used to play it + if(m_handler->nextEngine() == m_handler->currentEngine()) + m_state = PREPARING; + else + return; case PREPARING: if(m_core->totalTime() - m_handler->elapsed() < m_overlap) { @@ -92,7 +98,5 @@ void CrossfadePlugin::applyEffect(Buffer *b) void CrossfadePlugin::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { - //m_buffer_size = m_overlap * freq * chan * AudioParameters::sampleSize(format) / 1000; - //m_buffer =(uchar *) malloc(m_buffer_size); Effect::configure(freq, chan, format); } -- cgit v1.2.3-13-gbd6f