Skip to content

Commit

Permalink
Fixes AUP files import
Browse files Browse the repository at this point in the history
  • Loading branch information
crsib committed Nov 3, 2023
1 parent 575ac08 commit f8127fd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libraries/lib-wave-track/WaveTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,15 @@ bool WaveTrack::LinkConsistencyFix(bool doFix)
mLegacyRate = 0;
WaveTrackData::Get(*this).SetSampleFormat(mLegacyFormat);
}

// Check for zero-length clips and remove them
for (auto it = mClips.begin(); it != mClips.end();)
{
if ((*it)->IsEmpty())
it = mClips.erase(it);
else
++it;
}
}
return !err;
}
Expand Down Expand Up @@ -2831,12 +2840,6 @@ void WaveTrack::HandleXMLEndTag(const std::string_view& WXUNUSED(tag))
// File compatibility breaks have intervened long since, and the line above
// would now have undesirable side effects
#endif
// Check for zero-length clips and remove them
for (auto it = mClips.begin(); it != mClips.end();)
if ((*it)->IsEmpty())
it = mClips.erase(it);
else
++it;
}

XMLTagHandler *WaveTrack::HandleXMLChild(const std::string_view& tag)
Expand Down

0 comments on commit f8127fd

Please sign in to comment.