replace assert by ASSERT, so a proper log message is generated
[enigma2.git] / lib / dvb / subtitle.cpp
index b0c90222996ef71eb76b7d6a948ef4f45cd6caba..642327bb0e522d5c1275767b3f91a0eef37f5103 100644 (file)
@@ -345,6 +345,8 @@ int eDVBSubtitleParser::subtitle_process_segment(__u8 *segment)
                        }
                }
 
+               page->state = page_state;
+
                //eDebug("page updated: old: %d, new: %d", page->page_version_number, page_version_number);
                        // when acquisition point or mode change: remove all displayed pages.
                if ((page_state == 1) || (page_state == 2))
@@ -360,6 +362,13 @@ int eDVBSubtitleParser::subtitle_process_segment(__u8 *segment)
                        {
                                subtitle_region *p = page->regions->next;
                                //eDebug("delete region %d", page->regions->region_id);
+                               while(page->regions->region_objects)
+                               {
+                                       //eDebug("delete region object");
+                                       subtitle_region_object *ob = page->regions->region_objects->next;
+                                       delete page->regions->region_objects;
+                                       page->regions->region_objects = ob;
+                               }
                                delete page->regions;
                                page->regions = p;
                        }
@@ -451,6 +460,7 @@ int eDVBSubtitleParser::subtitle_process_segment(__u8 *segment)
                else if (region->region_version_number != region_version_number)
                {
                        subtitle_region_object *objects = region->region_objects;
+                       //eDebug("unequal version %p %p", objects, objects?objects->next:objects);
                        while (objects)
                        {
                                subtitle_region_object *n = objects->next;
@@ -748,10 +758,10 @@ int eDVBSubtitleParser::subtitle_process_segment(__u8 *segment)
 
 void eDVBSubtitleParser::subtitle_process_pes(__u8 *pkt, int len)
 {
-       //eDebugNoNewLine("subtitle_process_pes");
+       eDebugNoNewLine("subtitle_process_pes");
        if (!extract_pts(m_show_time, pkt))
        {
-               //eDebug(" %lld", m_show_time);
+               eDebug(" %lld", m_show_time);
                pkt += 6; len -= 6;
                // skip PES header
                pkt++; len--;
@@ -786,8 +796,8 @@ void eDVBSubtitleParser::subtitle_process_pes(__u8 *pkt, int len)
                if (len && *pkt != 0xFF)
                        eDebug("strange data at the end");
        }
-       //else
-               //eDebug("\ndvb subtitle packet without PTS.. ignore!!");
+       else
+               eDebug("\ndvb subtitle packet without PTS.. ignore!!");
 }
 
 void eDVBSubtitleParser::subtitle_redraw_all()
@@ -796,7 +806,8 @@ void eDVBSubtitleParser::subtitle_redraw_all()
        subtitle_page *page = m_pages;
        while(page)
        {
-               subtitle_redraw(page->page_id);
+               if (page->state != 0)
+                       subtitle_redraw(page->page_id);
                page = page->next;
        }
 #else