1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

AUP3: Detect and delete orphan blocks at startup

This commit is contained in:
Leland Lucius
2020-07-08 00:18:05 -05:00
parent f7d9513f8d
commit af6a23696b
3 changed files with 115 additions and 28 deletions

View File

@@ -60,7 +60,7 @@ public:
void SaveXML(XMLWriter &xmlFile) override;
private:
bool Load(SampleBlockID sbid);
void Load(SampleBlockID sbid);
bool GetSummary(float *dest,
size_t frameoffset,
size_t numframes,
@@ -186,6 +186,11 @@ SampleBlockPtr SqliteSampleBlockFactory::DoCreateFromXML(
{
// This may throw
sb->Load((SampleBlockID) nValue);
// Tell the IO manager the blockid we just loaded so it can track
// the highest one encountered.
mpIO->LoadedBlock(nValue);
found++;
}
else if (wxStrcmp(attr, wxT("samplecount")) == 0)
@@ -518,7 +523,7 @@ size_t SqliteSampleBlock::GetBlob(void *dest,
return srcbytes;
}
bool SqliteSampleBlock::Load(SampleBlockID sbid)
void SqliteSampleBlock::Load(SampleBlockID sbid)
{
auto db = mIO.DB();