OSDN Git Service

Switch to using QAtomicInc for abort flags.
[lamexp/LameXP.git] / src / Decoder_WavPack.cpp
index 3e012ac..25639f7 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2017 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ WavPackDecoder::~WavPackDecoder(void)
 {
 }
 
-bool WavPackDecoder::decode(const QString &sourceFile, const QString &outputFile, volatile bool *abortFlag)
+bool WavPackDecoder::decode(const QString &sourceFile, const QString &outputFile, QAtomicInt &abortFlag)
 {
        QProcess process;
        QStringList args;
@@ -69,7 +69,7 @@ bool WavPackDecoder::decode(const QString &sourceFile, const QString &outputFile
 
        while(process.state() != QProcess::NotRunning)
        {
-               if(*abortFlag)
+               if(checkFlag(abortFlag))
                {
                        process.kill();
                        bAborted = true;