From afc6029beb92e8b9b392d887242e7eaf24547c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20T=C3=B6rnblom?= Date: Sun, 18 Mar 2012 23:02:32 +0100 Subject: [PATCH] fix subtitle issues on comhem. Sometimes the subtitles would get stuck on the screen, sometimes only half of them delivered to the client. --- src/teletext.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/teletext.c b/src/teletext.c index ff7a72db..c559cac1 100644 --- a/src/teletext.c +++ b/src/teletext.c @@ -40,7 +40,6 @@ */ typedef struct tt_mag { int ttm_curpage; - int ttm_inactive; int64_t ttm_current_pts; uint8_t ttm_lang; uint8_t ttm_page[23*40 + 1]; @@ -397,8 +396,7 @@ tt_decode_line(service_t *t, elementary_stream_t *st, uint8_t *buf) case 0: if(ttm->ttm_curpage != 0) { - if(ttm->ttm_inactive == 0) - tt_subtitle_deliver(t, st, ttm); + tt_subtitle_deliver(t, st, ttm); if(ttm->ttm_curpage == 192) teletext_rundown_copy(ttp, ttm); @@ -429,11 +427,9 @@ tt_decode_line(service_t *t, elementary_stream_t *st, uint8_t *buf) teletext_rundown_scan(t, ttp); ttm->ttm_current_pts = t->s_current_pts; - ttm->ttm_inactive = 0; break; case 1 ... 23: - ttm->ttm_inactive = 0; for(i = 0; i < 40; i++) { c = buf[i + 2] & 0x7f; ttm->ttm_page[i + 40 * (line - 1)] = c; @@ -446,30 +442,6 @@ tt_decode_line(service_t *t, elementary_stream_t *st, uint8_t *buf) } - - -/** - * - */ -static void -teletext_scan_stream(service_t *t, elementary_stream_t *st) -{ - tt_private_t *ttp = st->es_priv; - tt_mag_t *ttm; - int i; - - if(ttp == NULL) - return; - for(i = 0; i < 8; i++) { - ttm = &ttp->ttp_mags[i]; - ttm->ttm_inactive++; - if(ttm->ttm_inactive == 2) { - tt_subtitle_deliver(t, st, ttm); - } - } -} - - /** * */ @@ -489,7 +461,6 @@ teletext_input(service_t *t, elementary_stream_t *st, const uint8_t *tsb) } x += 46; } - teletext_scan_stream(t, st); }