teletext.cpp: fix erase flag handling
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 11 Jun 2009 09:40:29 +0000 (11:40 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 11 Jun 2009 09:40:29 +0000 (11:40 +0200)
lib/dvb/teletext.cpp

index 40936d4a86aa07f169daee39a9b77dcd0b7a5317..7e1411b26a238a650f300441e4d3a0bd038d63b0 100644 (file)
@@ -482,7 +482,6 @@ void eDVBTeletextParser::handlePageStart()
                m_subtitle_page.clear();
                m_modifications.clear();
                m_X28_0_valid = 0;
-               m_new_subtitle_page(m_subtitle_page);
 //             eDebug("erase page!");
        }
 //     else
@@ -686,11 +685,10 @@ void eDVBTeletextParser::addSubtitleString(int color, std::string string)
 void eDVBTeletextParser::sendSubtitlePage()
 {
 //     eDebug("subtitle page:");
-       bool empty=true;
-       if (empty)
-               for (unsigned int i = 0; i < m_subtitle_page.m_elements.size(); ++i)
-                       if (!m_subtitle_page.m_elements[i].m_text.empty())
-                               empty=false;
-       if (!empty)
+       bool send=m_C & (1<<4);
+       for (unsigned int i = 0; i < m_subtitle_page.m_elements.size(); ++i)
+               if (!m_subtitle_page.m_elements[i].m_text.empty())
+                       send=true;
+       if (send)
                m_new_subtitle_page(m_subtitle_page);
 }