renderer/decoder: clean up decoders after some time

This commit is contained in:
itsmattkc
2021-04-30 11:13:57 +10:00
parent 6ca8dbb70a
commit 9d2ddbf727
8 changed files with 159 additions and 82 deletions
+9
View File
@@ -165,6 +165,11 @@ public:
*/
SampleBufferPtr RetrieveAudio(const TimeRange& range, const AudioParams& params, const QString &cache_path, Footage::LoopMode loop_mode, const QAtomicInt *cancelled);
/**
* @brief Determine the last time this decoder instance was used in any way
*/
qint64 GetLastAccessedTime();
/**
* @brief Generate a Footage object from a file
*
@@ -276,12 +281,16 @@ signals:
void IndexProgress(double);
private:
void UpdateLastAccessed();
SampleBufferPtr RetrieveAudioFromConform(const QString& conform_filename, const TimeRange &range, Footage::LoopMode loop_mode);
CodecStream stream_;
QMutex mutex_;
qint64 last_accessed_;
};
uint qHash(Decoder::CodecStream stream, uint seed = 0);