aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/rgscan
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-10-10 09:30:50 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-10-10 09:30:50 +0000
commitbc573bf071708d28a97be273b75d313b23e2a85a (patch)
tree0d1220694c6a564f3cc3a3443a6b3758f5cc4902 /src/plugins/General/rgscan
parentdbf94982d6ad11b159da6cdbb02582f8b4a83c6c (diff)
downloadqmmp-bc573bf071708d28a97be273b75d313b23e2a85a.tar.gz
qmmp-bc573bf071708d28a97be273b75d313b23e2a85a.tar.bz2
qmmp-bc573bf071708d28a97be273b75d313b23e2a85a.zip
rgscan: fixed blocking bug
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3769 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/rgscan')
-rw-r--r--src/plugins/General/rgscan/rgscandialog.cpp2
-rw-r--r--src/plugins/General/rgscan/rgscaner.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/General/rgscan/rgscandialog.cpp b/src/plugins/General/rgscan/rgscandialog.cpp
index 383bc687e..79e213a20 100644
--- a/src/plugins/General/rgscan/rgscandialog.cpp
+++ b/src/plugins/General/rgscan/rgscandialog.cpp
@@ -141,7 +141,9 @@ void RGScanDialog::stop()
if(m_scaners.isEmpty())
return;
foreach (RGScaner *scaner, m_scaners)
+ {
scaner->stop();
+ }
QThreadPool::globalInstance()->waitForDone();
qDeleteAll(m_scaners);
m_scaners.clear();
diff --git a/src/plugins/General/rgscan/rgscaner.cpp b/src/plugins/General/rgscan/rgscaner.cpp
index 99e0e1ac3..2f1d5cc01 100644
--- a/src/plugins/General/rgscan/rgscaner.cpp
+++ b/src/plugins/General/rgscan/rgscaner.cpp
@@ -104,6 +104,7 @@ bool RGScaner::prepare(const QString &url)
}
m_decoder = decoder;
m_source = source;
+ m_user_stop = false;
return true;
}
@@ -112,7 +113,6 @@ void RGScaner::stop()
m_mutex.lock();
m_user_stop = true;
m_mutex.unlock();
- wait();
}
bool RGScaner::isRunning()
@@ -137,6 +137,8 @@ GainHandle_t *RGScaner::handle()
void RGScaner::run()
{
+ if(m_user_stop)
+ return;
m_is_running = true;
qDebug("RGScaner: staring thread %lu", QThread::currentThreadId());
m_user_stop = false;
@@ -268,7 +270,7 @@ void RGScaner::run()
m_peak = max/32768.0;
qDebug("RGScaner: peak = %f", m_peak);
qDebug("RGScaner: thread %lu finished", QThread::currentThreadId());
- m_is_running = false;
emit progress(100);
emit finished(m_url);
+ m_is_running = false;
}