aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-04-18 18:39:32 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-04-18 18:39:32 +0000
commitfcd41290acbb1582f4e463ecaca868e52ec00bfb (patch)
tree95400ffd197f50546076c4625b57429b9326abb8 /src
parent12333b48c00518cbdb30b55d379d87e0fbf3880c (diff)
downloadqmmp-fcd41290acbb1582f4e463ecaca868e52ec00bfb.tar.gz
qmmp-fcd41290acbb1582f4e463ecaca868e52ec00bfb.tar.bz2
qmmp-fcd41290acbb1582f4e463ecaca868e52ec00bfb.zip
fixed freezing when using DirectSound output
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7122 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/qmmp/qmmpaudioengine.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/qmmp/qmmpaudioengine.cpp b/src/qmmp/qmmpaudioengine.cpp
index 0b7aa8aa5..8b271c255 100644
--- a/src/qmmp/qmmpaudioengine.cpp
+++ b/src/qmmp/qmmpaudioengine.cpp
@@ -248,7 +248,6 @@ void QmmpAudioEngine::pause()
m_output->recycler()->cond()->wakeAll();
m_output->recycler()->mutex()->unlock();
}
-
}
void QmmpAudioEngine::setMuted(bool muted)
@@ -276,19 +275,6 @@ void QmmpAudioEngine::stop()
if (m_output)
{
- m_output->mutex()->lock ();
- m_output->stop();
- m_output->mutex()->unlock();
- }
-
- // wake up threads
- if (m_output)
- {
- m_output->mutex()->lock();
- m_output->recycler()->cond()->wakeAll();
- m_output->mutex()->unlock();
- if(m_output->isRunning())
- m_output->wait();
delete m_output;
m_output = 0;
}
@@ -556,6 +542,22 @@ void QmmpAudioEngine::run()
m_output->mutex()->unlock();
}
mutex()->unlock();
+
+ if (m_output)
+ {
+ if(m_user_stop)
+ {
+ m_output->mutex()->lock ();
+ m_output->stop();
+ m_output->recycler()->cond()->wakeAll();
+ m_output->mutex()->unlock();
+ }
+
+ if((m_user_stop || m_finish) && m_output->isRunning())
+ {
+ m_output->wait();
+ }
+ }
}
void QmmpAudioEngine::flush(bool final)