Ticket #9236: 0001-Fix-mythuiimage-loading-for-non-animated-gif.patch

File 0001-Fix-mythuiimage-loading-for-non-animated-gif.patch, 1.6 KB (added by beirdo, 9 years ago)
  • mythtv/libs/libmythui/mythuiimage.cpp

    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 b void MythUIImage::Clear(void) 
    210210        m_Images.remove(it.key());
    211211    }
    212212    m_Delays.clear();
     213    if (m_animatedImage)
     214    {
     215        m_LowNum = 0;
     216        m_HighNum = 0;
     217        m_animatedImage = false;
     218    }
    213219}
    214220
    215221/**
    void MythUIImage::Reset(void) 
    221227    if (m_Filename != m_OrigFilename)
    222228    {
    223229        m_Filename = m_OrigFilename;
    224         m_animatedImage = false;
     230        if (m_animatedImage)
     231        {
     232            m_LowNum = 0;
     233            m_HighNum = 0;
     234            m_animatedImage = false;
     235        }
    225236        d->m_UpdateLock.unlock();
    226237        Load();
    227238    }
    bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat) 
    568579    QString imagelabel;
    569580
    570581    int j = 0;
    571     for (int i = m_LowNum; (i == m_LowNum  && !m_animatedImage) ||
    572                            (i <= m_HighNum &&  m_animatedImage); i++)
     582    for (int i = m_LowNum; i <= m_HighNum && !m_animatedImage; i++)
    573583    {
    574         if (!m_animatedImage && m_HighNum >= 1)
     584        if (!m_animatedImage && m_HighNum >= 1 && bFilename.contains("%1"))
    575585            filename = bFilename.arg(i);
    576586
    577587        imagelabel = GenImageLabel(filename, w, h);