mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-18 17:47:41 +02:00
AUP3: Fix flushing of tracks/clips in AUP importer
This commit is contained in:
parent
0c14e613c7
commit
7bb2417db3
@ -2460,7 +2460,6 @@ void DBConnection::CheckpointThread()
|
|||||||
mCheckpointCurrentPages.store( mCheckpointWaitingPages );
|
mCheckpointCurrentPages.store( mCheckpointWaitingPages );
|
||||||
mCheckpointWaitingPages = 0;
|
mCheckpointWaitingPages = 0;
|
||||||
}
|
}
|
||||||
wxLogDebug(wxT("thread pages %d"), mCheckpointCurrentPages.load());
|
|
||||||
|
|
||||||
// And kick off the checkpoint. This may not checkpoint ALL frames
|
// And kick off the checkpoint. This may not checkpoint ALL frames
|
||||||
// in the WAL. They'll be gotten the next time around.
|
// in the WAL. They'll be gotten the next time around.
|
||||||
@ -2486,7 +2485,7 @@ int DBConnection::CheckpointHook(void *data, sqlite3 *db, const char *schema, in
|
|||||||
std::lock_guard<std::mutex> guard(that->mCheckpointMutex);
|
std::lock_guard<std::mutex> guard(that->mCheckpointMutex);
|
||||||
that->mCheckpointWaitingPages = pages;
|
that->mCheckpointWaitingPages = pages;
|
||||||
that->mCheckpointCondition.notify_one();
|
that->mCheckpointCondition.notify_one();
|
||||||
wxLogDebug("hook pages %d", pages);
|
|
||||||
return SQLITE_OK;
|
return SQLITE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,6 @@ void SqliteSampleBlock::SetSamples(samplePtr src,
|
|||||||
sampleFormat srcformat)
|
sampleFormat srcformat)
|
||||||
{
|
{
|
||||||
mSampleFormat = srcformat;
|
mSampleFormat = srcformat;
|
||||||
|
|
||||||
mSampleCount = numsamples;
|
mSampleCount = numsamples;
|
||||||
mSampleBytes = mSampleCount * SAMPLE_SIZE(mSampleFormat);
|
mSampleBytes = mSampleCount * SAMPLE_SIZE(mSampleFormat);
|
||||||
mSamples.reinit(mSampleBytes);
|
mSamples.reinit(mSampleBytes);
|
||||||
|
@ -503,16 +503,9 @@ void AUPImportFileHandle::HandleXMLEndTag(const wxChar *tag)
|
|||||||
|
|
||||||
struct node node = mHandlers.back();
|
struct node node = mHandlers.back();
|
||||||
|
|
||||||
if (wxStrcmp(tag, wxT("wavetrack")) == 0)
|
if (wxStrcmp(tag, wxT("waveclip")) == 0)
|
||||||
{
|
|
||||||
WaveTrack *wt = static_cast<WaveTrack *>(node.handler);
|
|
||||||
|
|
||||||
wt->Flush();
|
|
||||||
}
|
|
||||||
else if (wxStrcmp(tag, wxT("waveclip")) == 0)
|
|
||||||
{
|
{
|
||||||
mClip = static_cast<WaveClip *>(node.handler);
|
mClip = static_cast<WaveClip *>(node.handler);
|
||||||
mClip->Flush();
|
|
||||||
mClip->HandleXMLEndTag(tag);
|
mClip->HandleXMLEndTag(tag);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1545,10 +1538,12 @@ bool AUPImportFileHandle::AddSamples(const FilePath &filename,
|
|||||||
if (mClip)
|
if (mClip)
|
||||||
{
|
{
|
||||||
mClip->Append(bufptr, format, cnt);
|
mClip->Append(bufptr, format, cnt);
|
||||||
|
mClip->Flush();
|
||||||
}
|
}
|
||||||
else if (mWaveTrack)
|
else if (mWaveTrack)
|
||||||
{
|
{
|
||||||
mWaveTrack->Append(bufptr, format, cnt);
|
mWaveTrack->Append(bufptr, format, cnt);
|
||||||
|
mWaveTrack->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let the finally block know everything is good
|
// Let the finally block know everything is good
|
||||||
|
Loading…
x
Reference in New Issue
Block a user