Delete "blank" output file, if encoding failed or was aborted (or never actually started).

This commit is contained in:
LoRd_MuldeR 2012-11-11 18:58:08 +01:00
parent 07dfd3211a
commit 8ba1c016c6
5 changed files with 86 additions and 75 deletions

View File

@ -2898,122 +2898,122 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>The format of this file is NOT supported:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>Container Format:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>Audio Format:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<location filename="../../src/Thread_Process.cpp" line="188"/>
<source>Unsupported!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Aborted!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="282"/>
<location filename="../../src/Thread_Process.cpp" line="293"/>
<source>Encoding</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="285"/>
<location filename="../../src/Thread_Process.cpp" line="296"/>
<source>Analyzing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="288"/>
<location filename="../../src/Thread_Process.cpp" line="299"/>
<source>Filtering</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="291"/>
<location filename="../../src/Thread_Process.cpp" line="302"/>
<source>Decoding</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="315"/>
<location filename="../../src/Thread_Process.cpp" line="326"/>
<source>The source audio file could not be found:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="323"/>
<location filename="../../src/Thread_Process.cpp" line="334"/>
<source>The source audio file could not be opened for reading:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="351"/>
<location filename="../../src/Thread_Process.cpp" line="362"/>
<source>The target output directory doesn&apos;t exist and could NOT be created:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="360"/>
<location filename="../../src/Thread_Process.cpp" line="371"/>
<source>The target output directory is NOT writable:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="371"/>
<location filename="../../src/Thread_Process.cpp" line="382"/>
<source>Unknown File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="373"/>
<location filename="../../src/Thread_Process.cpp" line="384"/>
<source>Unknown Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="374"/>
<location filename="../../src/Thread_Process.cpp" line="385"/>
<source>Unknown Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="375"/>
<location filename="../../src/Thread_Process.cpp" line="386"/>
<source>Unknown Album</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="377"/>
<location filename="../../src/Thread_Process.cpp" line="388"/>
<source>Unknown Comment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="386"/>
<location filename="../../src/Thread_Process.cpp" line="397"/>
<source>Target output file already exists, going to skip this file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="387"/>
<location filename="../../src/Thread_Process.cpp" line="398"/>
<source>If you don&apos;t want existing files to be skipped, please change the overwrite mode!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="394"/>
<location filename="../../src/Thread_Process.cpp" line="405"/>
<source>Target output file already exists, going to delete existing file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="404"/>
<location filename="../../src/Thread_Process.cpp" line="415"/>
<source>Failed to delete existing target file, will save to another file name!</source>
<translation type="unfinished"></translation>
</message>

View File

@ -2899,122 +2899,122 @@
<translation type="unfinished">UWAGA: Plik po zdekodowaniu przekracza 4 GB, mogą wystąpić problemy!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>The format of this file is NOT supported:</source>
<translation type="unfinished">Format tego pliku NIE jest obsługiwany:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>Container Format:</source>
<translation type="unfinished">Format kontenera:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>Audio Format:</source>
<translation type="unfinished">Format dźwięku:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<location filename="../../src/Thread_Process.cpp" line="188"/>
<source>Unsupported!</source>
<translation type="unfinished">Nieobsługiwany!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Done.</source>
<translation type="unfinished">Zrobione.</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Aborted!</source>
<translation type="unfinished">Przerwane!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Failed!</source>
<translation type="unfinished">Niepowodzenie!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="282"/>
<location filename="../../src/Thread_Process.cpp" line="293"/>
<source>Encoding</source>
<translation type="unfinished">Kompresowanie</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="285"/>
<location filename="../../src/Thread_Process.cpp" line="296"/>
<source>Analyzing</source>
<translation type="unfinished">Analizowanie</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="288"/>
<location filename="../../src/Thread_Process.cpp" line="299"/>
<source>Filtering</source>
<translation type="unfinished">Filtrowanie</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="291"/>
<location filename="../../src/Thread_Process.cpp" line="302"/>
<source>Decoding</source>
<translation type="unfinished">Dekodowanie</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="315"/>
<location filename="../../src/Thread_Process.cpp" line="326"/>
<source>The source audio file could not be found:</source>
<translation type="unfinished">Źródłowy plik dźwiękowy nie został odnaleziony:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="323"/>
<location filename="../../src/Thread_Process.cpp" line="334"/>
<source>The source audio file could not be opened for reading:</source>
<translation type="unfinished">Źródłowy plik dźwiękowy nie mógł zostać otworzony:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="351"/>
<location filename="../../src/Thread_Process.cpp" line="362"/>
<source>The target output directory doesn&apos;t exist and could NOT be created:</source>
<translation type="unfinished">Lokalizacja docelowa nie istnieje lu NIE mogła zostać utworzona:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="360"/>
<location filename="../../src/Thread_Process.cpp" line="371"/>
<source>The target output directory is NOT writable:</source>
<translation type="unfinished">Nie można zapisać do lokalizacji docelowej:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="371"/>
<location filename="../../src/Thread_Process.cpp" line="382"/>
<source>Unknown File Name</source>
<translation type="unfinished">Nieznana nazwa pliku</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="373"/>
<location filename="../../src/Thread_Process.cpp" line="384"/>
<source>Unknown Title</source>
<translation type="unfinished">Nieznany Tytuł</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="374"/>
<location filename="../../src/Thread_Process.cpp" line="385"/>
<source>Unknown Artist</source>
<translation type="unfinished">Nieznany Artysta</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="375"/>
<location filename="../../src/Thread_Process.cpp" line="386"/>
<source>Unknown Album</source>
<translation type="unfinished">Nieznany Album</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="377"/>
<location filename="../../src/Thread_Process.cpp" line="388"/>
<source>Unknown Comment</source>
<translation type="unfinished">Nieznany Komentarz</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="386"/>
<location filename="../../src/Thread_Process.cpp" line="397"/>
<source>Target output file already exists, going to skip this file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="387"/>
<location filename="../../src/Thread_Process.cpp" line="398"/>
<source>If you don&apos;t want existing files to be skipped, please change the overwrite mode!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="394"/>
<location filename="../../src/Thread_Process.cpp" line="405"/>
<source>Target output file already exists, going to delete existing file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="404"/>
<location filename="../../src/Thread_Process.cpp" line="415"/>
<source>Failed to delete existing target file, will save to another file name!</source>
<translation type="unfinished"></translation>
</message>

View File

@ -2900,122 +2900,122 @@
</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>The format of this file is NOT supported:</source>
<translation>Det här filformatet saknar stöd i LameXP:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>Container Format:</source>
<translation>Behållarformat:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="186"/>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<source>Audio Format:</source>
<translation>Ljudformat:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="187"/>
<location filename="../../src/Thread_Process.cpp" line="188"/>
<source>Unsupported!</source>
<translation>Stöd saknas!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Aborted!</source>
<translation>Avbruten!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Done.</source>
<translation>Klar.</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="265"/>
<location filename="../../src/Thread_Process.cpp" line="276"/>
<source>Failed!</source>
<translation>Misslyckades!</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="282"/>
<location filename="../../src/Thread_Process.cpp" line="293"/>
<source>Encoding</source>
<translation>Kodar</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="285"/>
<location filename="../../src/Thread_Process.cpp" line="296"/>
<source>Analyzing</source>
<translation>Analyserar</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="288"/>
<location filename="../../src/Thread_Process.cpp" line="299"/>
<source>Filtering</source>
<translation>Filtrerar</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="291"/>
<location filename="../../src/Thread_Process.cpp" line="302"/>
<source>Decoding</source>
<translation>Avkodar</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="315"/>
<location filename="../../src/Thread_Process.cpp" line="326"/>
<source>The source audio file could not be found:</source>
<translation>Källfilen kan inte hittas:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="323"/>
<location filename="../../src/Thread_Process.cpp" line="334"/>
<source>The source audio file could not be opened for reading:</source>
<translation>Källfilen kan inte öppnas för läsning:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="351"/>
<location filename="../../src/Thread_Process.cpp" line="362"/>
<source>The target output directory doesn&apos;t exist and could NOT be created:</source>
<translation>Målmappen finns inte och kan inte skapas:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="360"/>
<location filename="../../src/Thread_Process.cpp" line="371"/>
<source>The target output directory is NOT writable:</source>
<translation>Målmappen är INTE skrivbar:</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="371"/>
<location filename="../../src/Thread_Process.cpp" line="382"/>
<source>Unknown File Name</source>
<translation>Okänt filnamn</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="373"/>
<location filename="../../src/Thread_Process.cpp" line="384"/>
<source>Unknown Title</source>
<translation>Okänd titel</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="374"/>
<location filename="../../src/Thread_Process.cpp" line="385"/>
<source>Unknown Artist</source>
<translation>Okänd artist</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="375"/>
<location filename="../../src/Thread_Process.cpp" line="386"/>
<source>Unknown Album</source>
<translation>Okänt album</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="377"/>
<location filename="../../src/Thread_Process.cpp" line="388"/>
<source>Unknown Comment</source>
<translation>Okänd kommentar</translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="386"/>
<location filename="../../src/Thread_Process.cpp" line="397"/>
<source>Target output file already exists, going to skip this file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="387"/>
<location filename="../../src/Thread_Process.cpp" line="398"/>
<source>If you don&apos;t want existing files to be skipped, please change the overwrite mode!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="394"/>
<location filename="../../src/Thread_Process.cpp" line="405"/>
<source>Target output file already exists, going to delete existing file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Thread_Process.cpp" line="404"/>
<location filename="../../src/Thread_Process.cpp" line="415"/>
<source>Failed to delete existing target file, will save to another file name!</source>
<translation type="unfinished"></translation>
</message>

View File

@ -29,8 +29,8 @@
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 7
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 1177
#define VER_LAMEXP_PATCH 2
#define VER_LAMEXP_BUILD 1178
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

View File

@ -183,6 +183,7 @@ void ProcessThread::processFile()
}
else
{
if(QFileInfo(outFileName).exists() && (QFileInfo(outFileName).size() < 512)) QFile::remove(outFileName);
handleMessage(QString("%1\n%2\n\n%3\t%4\n%5\t%6").arg(tr("The format of this file is NOT supported:"), m_audioFile.filePath(), tr("Container Format:"), m_audioFile.formatContainerInfo(), tr("Audio Format:"), m_audioFile.formatAudioCompressInfo()));
emit processStateChanged(m_jobId, tr("Unsupported!"), ProgressModel::JobFailed);
emit processStateFinished(m_jobId, outFileName, 0);
@ -252,8 +253,18 @@ void ProcessThread::processFile()
bSuccess = m_encoder->encode(sourceFile, m_audioFile, outFileName, &m_aborted);
}
//Clean-up
if((!bSuccess) || m_aborted)
{
QFileInfo fileInfo(outFileName);
if(fileInfo.exists() && (fileInfo.size() < 512))
{
QFile::remove(outFileName);
}
}
//Make sure output file exists
if(bSuccess && !m_aborted)
if(bSuccess && (!m_aborted))
{
QFileInfo fileInfo(outFileName);
bSuccess = fileInfo.exists() && fileInfo.isFile() && (fileInfo.size() > 0);