nodes: rewrote and simplified length signaling system

This commit is contained in:
itsmattkc
2021-07-15 21:00:18 -07:00
parent 8350ce300f
commit 4bbc75392a
20 changed files with 148 additions and 241 deletions
+1 -12
View File
@@ -92,7 +92,7 @@ void FrameHashCache::SetTimebase(const rational &tb)
void FrameHashCache::ValidateFramesWithHash(const QByteArray &hash)
{
const TimeRangeList& invalidated_ranges = GetInvalidatedRanges();
auto invalidated_ranges = GetInvalidatedRanges(ToTime(GetMapSize()));
for (int64_t i=0; i<GetMapSize(); i++) {
if (time_hash_map_[i] == hash) {
@@ -241,17 +241,6 @@ FramePtr FrameHashCache::LoadCacheFrame(const QString &fn)
return frame;
}
void FrameHashCache::LengthChangedEvent(const rational &old, const rational &newlen)
{
if (newlen < old) {
// Determine length in frames by ceil-ing the time
int64_t new_ts_length = ToTimestamp(newlen, Timecode::kCeil);
// Resize vector to this length, which will discard all frames after it
time_hash_map_.resize(new_ts_length);
}
}
struct HashTimePair {
rational time;
QByteArray hash;