From c47690cec81dd525497c352ec6a397efce59aa44 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 15 Nov 2011 08:48:58 +0000 Subject: [PATCH] Clear p26 extended data, possible fix for Norwegian ttx subtitles. patch from Henrik Nilsson git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1847 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/54255df7dfb8a25e7e74ac2831f71e641c9f4699 Author: [CST] Focus Date: 2011-11-15 (Tue, 15 Nov 2011) ------------------ This commit was generated by Migit --- lib/libtuxtxt/tuxtxt.cpp | 1 + lib/libtuxtxt/tuxtxt.h | 1 + lib/libtuxtxt/tuxtxt_common.h | 15 +++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 926a062c2..35f86b8c7 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -1444,6 +1444,7 @@ void eval_l25() #endif APx0 = APy0 = APx = APy = tAPx = tAPy = 0; eval_object(13 * (23-2 + 2), tuxtxt_cache.astCachetable[tuxtxt_cache.page][tuxtxt_cache.subpage], &APx, &APy, &APx0, &APy0, OBJ_ACTIVE, &page_char[40]); /* 1st triplet p26/0 */ + tuxtxt_clear_p26(pi->ext); } { diff --git a/lib/libtuxtxt/tuxtxt.h b/lib/libtuxtxt/tuxtxt.h index 52a4fedba..a02125b81 100644 --- a/lib/libtuxtxt/tuxtxt.h +++ b/lib/libtuxtxt/tuxtxt.h @@ -61,6 +61,7 @@ extern void tuxtxt_decode_btt(); extern void tuxtxt_decode_adip(); /* additional information table */ extern void tuxtxt_compress_page(int p, int sp, unsigned char* buffer); extern void tuxtxt_decompress_page(int p, int sp, unsigned char* buffer); +extern void tuxtxt_clear_p26(tstExtData* extData); #if TUXTXT_DEBUG extern int tuxtxt_get_zipsize(int p, int sp); #endif diff --git a/lib/libtuxtxt/tuxtxt_common.h b/lib/libtuxtxt/tuxtxt_common.h index 783c485d8..6607b589e 100644 --- a/lib/libtuxtxt/tuxtxt_common.h +++ b/lib/libtuxtxt/tuxtxt_common.h @@ -520,6 +520,21 @@ void tuxtxt_erase_page(int magazine) } } +void tuxtxt_clear_p26(tstExtData* extData) +{ + pthread_mutex_lock(&tuxtxt_cache_lock); + + for(int i = 0; i < 16; ++i) + { + if(0 != extData->p26[i]) + { + memset(extData->p26[i], 0x00, 13 * 3); + } + } + + pthread_mutex_unlock(&tuxtxt_cache_lock); +} + void tuxtxt_allocate_cache(int magazine) { // Lock here as we have a possible race here with