From 94de485531c7bbb04f577c9ad0e9e0dbb8a55ae6 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 26 Aug 2015 19:46:19 +0000 Subject: lock mutext before reset of elapsed time counter git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5497 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/qmmpaudioengine.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/qmmp/qmmpaudioengine.cpp b/src/qmmp/qmmpaudioengine.cpp index d34d42b51..6d76ff591 100644 --- a/src/qmmp/qmmpaudioengine.cpp +++ b/src/qmmp/qmmpaudioengine.cpp @@ -412,12 +412,14 @@ void QmmpAudioEngine::run() StateHandler::instance()->sendFinished(); StateHandler::instance()->dispatch(Qmmp::Stopped); //fake stop/start cycle StateHandler::instance()->dispatch(Qmmp::Buffering); - StateHandler::instance()->dispatch(Qmmp::Playing); m_decoder->next(); StateHandler::instance()->dispatch(m_decoder->totalTime()); m_replayGain->setReplayGainInfo(m_decoder->replayGainInfo(), m_decoder->hasHeadroom()); + m_output->mutex()->lock(); m_output->seek(0); //reset counter + m_output->mutex()->unlock(); addOffset(); //offset + StateHandler::instance()->dispatch(Qmmp::Playing); mutex()->unlock(); continue; } @@ -435,9 +437,11 @@ void QmmpAudioEngine::run() StateHandler::instance()->sendFinished(); StateHandler::instance()->dispatch(Qmmp::Stopped); //fake stop/start cycle StateHandler::instance()->dispatch(Qmmp::Buffering); - StateHandler::instance()->dispatch(Qmmp::Playing); StateHandler::instance()->dispatch(m_decoder->totalTime()); + m_output->mutex()->lock(); m_output->seek(0); //reset counter + m_output->mutex()->unlock(); + StateHandler::instance()->dispatch(Qmmp::Playing); mutex()->unlock(); sendMetaData(); addOffset(); //offset -- cgit v1.2.3-13-gbd6f