1 --- enigma_org/lib/dvb/subtitle.cpp 2 Aug 2005 20:35:36 -0000 1.13
2 +++ enigma/lib/dvb/subtitle.cpp 21 Nov 2007 11:52:51 -0000
4 delete page->page_regions;
5 page->page_regions = p;
7 + while (page->regions)
9 + struct subtitle_region *p = page->regions->next;
10 + while(page->regions->region_objects)
12 + subtitle_region_object *ob = page->regions->region_objects->next;
13 + delete page->regions->region_objects;
14 + page->regions->region_objects = ob;
16 + delete [] page->regions->region_buffer;
17 + delete page->regions;
22 // eDebug("new page.. (%d)", page_state);
29 + if (processed_length == segment_length && !page->page_regions)
31 +// eDebug("no regions in page.. clear screen!!");
32 + if (sub->screen_enabled)
33 + subtitle_redraw_all(sub);
36 while (processed_length < segment_length)
38 struct subtitle_page_region *pr;
41 struct subtitle_page *page = sub->pages;
44 - struct subtitle_page_region *region = page->page_regions;
46 - subtitle_clear_screen(sub);
48 + subtitle_clear_screen(sub);
51 subtitle_redraw(sub, page->page_id);
55 - subtitle_clear_screen(sub);
57 struct subtitle_page *page = sub->pages;
59 + subtitle_clear_screen(sub);
60 //eDebug("----------- end of display set");
61 //eDebug("active pages:");
68 //eDebug("iterating regions..");
69 /* iterate all regions in this pcs */
70 struct subtitle_page_region *region = page->page_regions;
73 if (main_clut_id != clut_id)
75 -// eDebug("MULTIPLE CLUTS IN USE! prepare for pixelmuell!");
76 + eDebug("MULTIPLE CLUTS IN USE! prepare for pixelmuell!");
80 main_clut_id = clut_id;
83 - //eDebug("copy region %d to %d, %d", region->region_id, region->region_horizontal_address, region->region_vertical_address);
85 int x0 = region->region_horizontal_address;
86 int y0 = region->region_vertical_address;
87 int x1 = x0 + reg->region_width;
88 int y1 = y0 + reg->region_height;
91 + //eDebug("copy region %d to %d, %d, size %d %d", region->region_id, x0, y0, x1, y1);
93 if ((x0 < 0) || (y0 < 0) || (x0 > sub->screen_width) || (x0 > sub->screen_height))
96 --- enigma_org/lib/dvb/subtitling.cpp 2 Aug 2005 20:35:36 -0000 1.12
97 +++ enigma/lib/dvb/subtitling.cpp 21 Nov 2007 11:52:51 -0000
99 unsigned long long current = 0;
100 if (Decoder::getSTC(current))
101 eDebug("bloed, going unsyced");
102 - eDebug("DEMUX STC: %08llx\n", current);
103 + eDebug("DEMUX STC: %08llx", current);
105 unsigned long long pts = 0;
109 - if (!queue.empty())
111 - else if (!extractPTS(pts, pkt))
112 + int enqueue = !queue.empty();
114 + if (!extractPTS(pts, pkt))
116 - eDebug("PES STC: %08llx\n", pts);
117 + eDebug("PES STC: %08llx", pts);
118 signed long long int diff = pts - current;
119 - eDebug(" STC: %lld\n", diff);
120 - if (diff > 900000) // 10s
122 - eDebug("rediculous high delay! showing now");
123 - } else if (diff > 2000)
124 + eDebug(" diff: %lld(%lldms)", diff, diff/90);
127 + else if (enqueue) // this should not happen !!
129 + eDebug("showing instantly, diff small enough... but queue not empy!!!!");
133 - eDebug("showing instantly, diff small enough!");
134 + eDebug("showing instantly, diff small enough...!");
139 memcpy(pes.pkt, pkt, len);
145 - eDebug("setting timer to %d ms!\n", (pes.pts - current) / 90);
146 + eDebug("setting timer to %lld ms!\n", (pes.pts - current) / 90);
147 timer.start((pes.pts - current) / 90, 1);
154 subtitle_process_pes(subtitle, pesbuffer, peslen);
155 @@ -155,13 +159,15 @@
159 - eDebug("by the way, actual delay was %lld(%lld msek)\n", current - fpts, (current-fpts)/90 );
160 + eDebug("by the way, actual delay was %lld(%lld msek)", current - fpts, (current-fpts)/90 );
165 - signed long long int diff = queue.front().pts - current;
166 - timer.start(diff / 90, 1);
167 + if (!queue.empty()) {
168 + signed long long int diff = queue.front().pts - current;
169 + timer.start(diff / 90, 1);
170 + eDebug("setting timer to %lld ms!\n", diff / 90);
176 void eSubtitleWidget::gotData(int what)
178 while (!queue.empty())
180 pes_packet_s pkt = queue.front();