1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 09:01:12 +01:00

More uses of SampleBuffer, eliminating explicit DeleteSamples calls

This commit is contained in:
Paul Licameli
2016-02-01 10:16:00 -05:00
parent 508286661a
commit 321d5259a2
22 changed files with 145 additions and 156 deletions

View File

@@ -202,11 +202,13 @@ static void RemoveDependencies(AudacityProject *project,
// Convert it from an aliased file to an actual file in the project.
unsigned int len = aliasBlockFile->GetLength();
samplePtr buffer = NewSamples(len, format);
f->ReadData(buffer, format, 0, len);
BlockFile *newBlockFile =
dirManager->NewSimpleBlockFile(buffer, len, format);
DeleteSamples(buffer);
BlockFile *newBlockFile;
{
SampleBuffer buffer(len, format);
f->ReadData(buffer.ptr(), format, 0, len);
newBlockFile =
dirManager->NewSimpleBlockFile(buffer.ptr(), len, format);
}
// Update our hash so we know what block files we've done
blockFileHash[f] = newBlockFile;