OSDN Git Service

Made getLogFile() function "const" and made sure that we will return a const referenc...
[lamexp/LameXP.git] / src / Decoder_Speex.cpp
index 5d89add..03b7bb6 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2012 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
@@ -69,11 +69,12 @@ bool SpeexDecoder::decode(const QString &sourceFile, const QString &outputFile,
                        emit messageLogged("\nABORTED BY USER !!!");
                        break;
                }
-               process.waitForReadyRead();
+               process.waitForReadyRead(m_processTimeoutInterval);
                if(!process.bytesAvailable() && process.state() == QProcess::Running)
                {
                        process.kill();
                        qWarning("SpeexDec process timed out <-- killing!");
+                       emit messageLogged("\nPROCESS TIMEOUT !!!");
                        bTimeout = true;
                        break;
                }
@@ -102,7 +103,7 @@ bool SpeexDecoder::decode(const QString &sourceFile, const QString &outputFile,
        emit statusUpdated(100);
        emit messageLogged(QString().sprintf("\nExited with code: 0x%04X", process.exitCode()));
 
-       if(bTimeout || bAborted || process.exitStatus() != QProcess::NormalExit || QFileInfo(outputFile).size() == 0)
+       if(bTimeout || bAborted || process.exitCode() != EXIT_SUCCESS || QFileInfo(outputFile).size() == 0)
        {
                return false;
        }