From e2f25b7e9f00f7ce799fe196284ef1222a23f2fc Mon Sep 17 00:00:00 2001
From: Gavin Hurlbut <ghurlbut@mythtv.org>
Date: Fri, 19 Nov 2010 00:01:47 -0800
Subject: [PATCH] Fix mythuiimage loading for non-animated gif


diff --git a/mythtv/libs/libmythui/mythuiimage.cpp b/mythtv/libs/libmythui/mythuiimage.cpp
index aea84e6..4318366 100644
--- a/mythtv/libs/libmythui/mythuiimage.cpp
+++ b/mythtv/libs/libmythui/mythuiimage.cpp
@@ -210,6 +210,12 @@ void MythUIImage::Clear(void)
         m_Images.remove(it.key());
     }
     m_Delays.clear();
+    if (m_animatedImage)
+    {
+        m_LowNum = 0;
+        m_HighNum = 0;
+        m_animatedImage = false;
+    }
 }
 
 /**
@@ -221,7 +227,12 @@ void MythUIImage::Reset(void)
     if (m_Filename != m_OrigFilename)
     {
         m_Filename = m_OrigFilename;
-        m_animatedImage = false;
+        if (m_animatedImage)
+        {
+            m_LowNum = 0;
+            m_HighNum = 0;
+            m_animatedImage = false;
+        }
         d->m_UpdateLock.unlock();
         Load();
     }
@@ -568,10 +579,9 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat)
     QString imagelabel;
 
     int j = 0;
-    for (int i = m_LowNum; (i == m_LowNum  && !m_animatedImage) || 
-                           (i <= m_HighNum &&  m_animatedImage); i++)
+    for (int i = m_LowNum; i <= m_HighNum && !m_animatedImage; i++)
     {
-        if (!m_animatedImage && m_HighNum >= 1)
+        if (!m_animatedImage && m_HighNum >= 1 && bFilename.contains("%1"))
             filename = bFilename.arg(i);
 
         imagelabel = GenImageLabel(filename, w, h);
-- 
1.7.0.4

