mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-20 14:20:06 +02:00
In DirManager.cpp, probably fixed bug 451, by not deleting over-long blockfile.
Made Sequence::HandleXMLEndTag log errors more specific. Differentiated "Gap detected in project file" error messages.
This commit is contained in:
parent
7b04d6518d
commit
4d1e18d8fd
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
The blockfile/directory scheme is rather complicated with two different schemes.
|
The blockfile/directory scheme is rather complicated with two different schemes.
|
||||||
The current scheme uses two levels of subdirectories - up to 256 'eXX' and up to
|
The current scheme uses two levels of subdirectories - up to 256 'eXX' and up to
|
||||||
256 'dYY' directories with in each of the 'eXX' dirs, where XX and YY are hex chars.
|
256 'dYY' directories within each of the 'eXX' dirs, where XX and YY are hex chars.
|
||||||
In each of the dXX directories there are up to 256 audio files (e.g. .au or .auf).
|
In each of the dXX directories there are up to 256 audio files (e.g. .au or .auf).
|
||||||
They have a filename scheme of 'eXXYYZZZZ', where XX and YY refers to the
|
They have a filename scheme of 'eXXYYZZZZ', where XX and YY refers to the
|
||||||
subdirectories as above. The 'ZZZZ' component is generated randomly for some reason.
|
subdirectories as above. The 'ZZZZ' component is generated randomly for some reason.
|
||||||
@ -1050,6 +1050,9 @@ bool DirManager::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
((mMaxSamples > -1) && // is initialized
|
((mMaxSamples > -1) && // is initialized
|
||||||
(pBlockFile->GetLength() > mMaxSamples)))
|
(pBlockFile->GetLength() > mMaxSamples)))
|
||||||
{
|
{
|
||||||
|
// See http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c13.
|
||||||
|
// Lock pBlockFile so that the ~BlockFile() will not delete the file on disk.
|
||||||
|
pBlockFile->Lock();
|
||||||
delete pBlockFile;
|
delete pBlockFile;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -827,7 +827,7 @@ void Sequence::HandleXMLEndTag(const wxChar *tag)
|
|||||||
if (wxStrcmp(tag, wxT("sequence")) != 0)
|
if (wxStrcmp(tag, wxT("sequence")) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Make sure that the sequence is valid
|
// Make sure that the sequence is valid.
|
||||||
// First, replace missing blockfiles with SilentBlockFiles
|
// First, replace missing blockfiles with SilentBlockFiles
|
||||||
unsigned int b;
|
unsigned int b;
|
||||||
for (b = 0; b < mBlock->Count(); b++) {
|
for (b = 0; b < mBlock->Count(); b++) {
|
||||||
@ -840,11 +840,15 @@ void Sequence::HandleXMLEndTag(const wxChar *tag)
|
|||||||
len = mNumSamples - mBlock->Item(b)->start;
|
len = mNumSamples - mBlock->Item(b)->start;
|
||||||
|
|
||||||
if (len > mMaxSamples)
|
if (len > mMaxSamples)
|
||||||
|
{
|
||||||
// This could be why the blockfile failed, so limit
|
// This could be why the blockfile failed, so limit
|
||||||
// the silent replacement to mMaxSamples.
|
// the silent replacement to mMaxSamples.
|
||||||
len = mMaxSamples;
|
len = mMaxSamples;
|
||||||
|
wxLogError(_(" Sequence has missing block file with length > mMaxSamples."));
|
||||||
|
}
|
||||||
mBlock->Item(b)->f = new SilentBlockFile(len);
|
mBlock->Item(b)->f = new SilentBlockFile(len);
|
||||||
wxLogError(_("Gap detected in project file."));
|
wxLogError(
|
||||||
|
_("Gap detected in project file. Missing block file replaced with silence."));
|
||||||
mErrorOpening = true;
|
mErrorOpening = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -854,14 +858,14 @@ void Sequence::HandleXMLEndTag(const wxChar *tag)
|
|||||||
for (b = 0; b < mBlock->Count(); b++) {
|
for (b = 0; b < mBlock->Count(); b++) {
|
||||||
if (mBlock->Item(b)->start != numSamples) {
|
if (mBlock->Item(b)->start != numSamples) {
|
||||||
mBlock->Item(b)->start = numSamples;
|
mBlock->Item(b)->start = numSamples;
|
||||||
wxLogError(_("Gap detected in project file."));
|
wxLogError(_("Gap detected in project file.\n Block specification for block file started after end of previous block.\n Start has been moved back so blocks are contiguous."));
|
||||||
mErrorOpening = true;
|
mErrorOpening = true;
|
||||||
}
|
}
|
||||||
numSamples += mBlock->Item(b)->f->GetLength();
|
numSamples += mBlock->Item(b)->f->GetLength();
|
||||||
}
|
}
|
||||||
if (mNumSamples != numSamples) {
|
if (mNumSamples != numSamples) {
|
||||||
mNumSamples = numSamples;
|
mNumSamples = numSamples;
|
||||||
wxLogError(_("Gap detected in project file."));
|
wxLogError(_("Gap detected in project file. Sequence sample count corrected."));
|
||||||
mErrorOpening = true;
|
mErrorOpening = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user