renderer: remove frames from hash map as well when the diskmanager deletes
them
This commit is contained in:
@@ -83,7 +83,7 @@ void VideoRenderFrameCache::RemoveHashFromCurrentlyCaching(const QByteArray &has
|
||||
currently_caching_list_.removeOne(hash);
|
||||
}
|
||||
|
||||
QList<rational> VideoRenderFrameCache::FramesWithHash(const QByteArray &hash)
|
||||
QList<rational> VideoRenderFrameCache::FramesWithHash(const QByteArray &hash) const
|
||||
{
|
||||
QList<rational> times;
|
||||
|
||||
@@ -98,6 +98,25 @@ QList<rational> VideoRenderFrameCache::FramesWithHash(const QByteArray &hash)
|
||||
return times;
|
||||
}
|
||||
|
||||
QList<rational> VideoRenderFrameCache::TakeFramesWithHash(const QByteArray &hash)
|
||||
{
|
||||
QList<rational> times;
|
||||
|
||||
QMap<rational, QByteArray>::iterator iterator = time_hash_map_.begin();
|
||||
|
||||
while (iterator != time_hash_map_.end()) {
|
||||
if (iterator.value() == hash) {
|
||||
times.append(iterator.key());
|
||||
|
||||
iterator = time_hash_map_.erase(iterator);
|
||||
} else {
|
||||
iterator++;
|
||||
}
|
||||
}
|
||||
|
||||
return times;
|
||||
}
|
||||
|
||||
const QMap<rational, QByteArray> &VideoRenderFrameCache::time_hash_map() const
|
||||
{
|
||||
return time_hash_map_;
|
||||
|
||||
Reference in New Issue
Block a user