From 95664a2a80bc790f410c96505f9d1f47c2fb8e06 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sun, 4 Aug 2013 22:11:24 +0100 Subject: [PATCH] Don't perform last modified checks on internet images which are in the memory cache, this causes an unnecessary delay. --- mythtv/libs/libmythui/mythuihelper.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythui/mythuihelper.cpp b/mythtv/libs/libmythui/mythuihelper.cpp index 74bce05bc2f..a200382f054 100644 --- a/mythtv/libs/libmythui/mythuihelper.cpp +++ b/mythtv/libs/libmythui/mythuihelper.cpp @@ -1531,8 +1531,17 @@ MythImage *MythUIHelper::LoadCacheImage(QString srcfile, QString label, (srcfile.startsWith("https://")) || (srcfile.startsWith("ftp://"))) { - srcLastModified = - GetMythDownloadManager()->GetLastModified(srcfile); + // If the image is in the memory cache then skip the last modified + // check, since memory cached images are loaded in the foreground + // this can cause an intolerable delay. The images won't stay in + // the cache forever and so eventually they will be checked. + if (ret) + srcLastModified = cacheFileInfo.lastModified(); + else + { + srcLastModified = + GetMythDownloadManager()->GetLastModified(srcfile); + } } else if (srcfile.startsWith("myth://")) srcLastModified = RemoteFile::LastModified(srcfile);