Skip to content

Commit

Permalink
Don't force background loading for remote images if they are already
Browse files Browse the repository at this point in the history
in the memory cache

Refs #11717
  • Loading branch information
stuartm committed Aug 2, 2013
1 parent c8e339f commit d550033
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions mythtv/libs/libmythui/mythuiimage.cpp
Expand Up @@ -954,12 +954,6 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat)
return false;
}

bool bPreferLoadInBackground =
((filename.startsWith("myth://")) ||
(filename.startsWith("http://")) ||
(filename.startsWith("https://")) ||
(filename.startsWith("ftp://")));

if (getenv("DISABLETHREADEDMYTHUIIMAGE"))
allowLoadInBackground = false;

Expand Down Expand Up @@ -1000,20 +994,13 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat)
bool do_background_load = false;
if (allowLoadInBackground)
{
if (bPreferLoadInBackground)
{
do_background_load = true;
}
MythImage *img = GetMythUI()->LoadCacheImage(
filename, imagelabel, GetPainter(),
static_cast<ImageCacheMode>(cacheMode));
if (img)
img->DecrRef();
else
{
MythImage *img = GetMythUI()->LoadCacheImage(
filename, imagelabel, GetPainter(),
static_cast<ImageCacheMode>(cacheMode));
if (img)
img->DecrRef();
else
do_background_load = true;
}
do_background_load = true;
}

if (!isAnimation && !GetMythUI()->IsImageInCache(imagelabel))
Expand Down

0 comments on commit d550033

Please sign in to comment.