diff options
| author | Ville Skyttä <ville.skytta@iki.fi> | 2013-05-03 22:52:34 +0300 |
|---|---|---|
| committer | Ville Skyttä <ville.skytta@iki.fi> | 2013-05-03 22:52:34 +0300 |
| commit | 65156fac929e4c8507ff52a0782f76025bf7a9e8 (patch) | |
| tree | 0725a5485f3000cac030f43be1e7794e621f8cd8 | |
| parent | e9fb26901c9bc66cca4cd631b1bee4fb973541f2 (diff) | |
| download | vdr-plugin-ttxtsubs-65156fac929e4c8507ff52a0782f76025bf7a9e8.tar.gz vdr-plugin-ttxtsubs-65156fac929e4c8507ff52a0782f76025bf7a9e8.tar.bz2 | |
Clean up dead code.
| -rw-r--r-- | teletext.c | 66 | ||||
| -rw-r--r-- | teletext.h | 8 | ||||
| -rw-r--r-- | ttxtaudio.c | 4 | ||||
| -rw-r--r-- | ttxtsubsdisplayer.c | 2 | ||||
| -rw-r--r-- | ttxtsubsdisplayer.h | 2 |
5 files changed, 3 insertions, 79 deletions
@@ -53,72 +53,6 @@ unsigned char unham(unsigned char a,unsigned char b) } -// ham 8/4 the byte in into two bytes pointed to by out -// should make a table instead -void ham8_4byte(uint8_t in, uint8_t *out) -{ - out[0] = ham8_4nibble(in & 0xF); - out[1] = ham8_4nibble(in >> 4); - - if (1) { // XXX debug - int a; - if(unham(out[0], out[1]) != in) { - dprint("ham8_4: 1 - result not correct %02x -> %02x %02x!\n", in, out[0], out[1]); - } - a = unhamtab[out[0]]; - a ^= 0x80; - if(a & 0xf0 || (a != (in & 0xF))) { - dprint("ham8_4: 2 - result not correct %02x -> %02x %02x, %02x!\n", in, out[0], out[1], a); - } - a = unhamtab[out[1]]; - a ^= 0x80; - if(a & 0xf0 || (a != (in >> 4))) { - dprint("ham8_4: 3 - result not correct %02x -> %02x %02x, %02x!\n", in, out[0], out[1], a); - } - } -} - -// should be a table instead -int parity(uint8_t x) { - int res = 1; - int count = x & 0xf0 ? 8 : 4; - - while(count--) { - if(x & 0x01) - res = !res; - x >>= 1; - } - - return res; -} - -// ham 8/4 the nibble in into the byte pointed to by out -// should make a table instead -// D4 P4 D3 P3 D2 P2 D1 P1 -// P4 = all the rest -uint8_t ham8_4nibble(uint8_t in) -{ - uint8_t o = 0; - - // insert the data bits - o |= (in << 4) & 0x80; - o |= (in << 3) & 0x20; - o |= (in << 2) & 0x08; - o |= (in << 1) & 0x02; - - if(parity(in & 0x0d)) // P1 = 1 . D1 . D3 . D4 - o |= 0x01; - if(parity(in & 0x0b)) // P2 = 1 . D1 . D2 . D4 - o |= 0x04; - if(parity(in & 0x07)) // P3 = 1 . D1 . D2 . D3 - o |= 0x10; - if(parity(o & 0xbf)) // P4 = 1 . P1 . D1 . ... . D3 . D4 - o |= 0x40; - - return o; -} - - /* * Map Latin G0 teletext characters into a ISO-8859-1 approximation. * Trying to use similar looking or similar meaning characters. @@ -83,14 +83,6 @@ unsigned char unham(unsigned char a,unsigned char b); #define UNHAM_INV(a, b) unham(invtab[a], invtab[b]) -// ham 8/4 the byte in into two bytes pointed to by out -void ham8_4byte(uint8_t in, uint8_t *out); -// ham 8/4 the nibble in into the byte pointed to by out -uint8_t ham8_4nibble(uint8_t in); - -// odd parity status for last 7 bits of byte -int parity(uint8_t x); - /* * Map Latin G0 teletext characters into a ISO-8859-1 approximation. * Trying to use similar looking or similar meaning characters. diff --git a/ttxtaudio.c b/ttxtaudio.c index ac2135c..1d64e16 100644 --- a/ttxtaudio.c +++ b/ttxtaudio.c @@ -21,15 +21,13 @@ cTtxtAudio::~cTtxtAudio() void cTtxtAudio::Play(const uchar* p, int Length, uchar Id) { int64_t tmp_pts = 0; - bool audio_pts_wrap = false; if (PesHasPts(p)) tmp_pts = PesGetPts(p); if (tmp_pts != 0) { if ((pts > 0x1ffff0000LL) && (tmp_pts < 0x000100000LL)) { - audio_pts_wrap=true; + tmp_pts+=0x200000000LL; } - if (audio_pts_wrap) { tmp_pts+=0x200000000LL; } } if (tmp_pts != pts) { pts=tmp_pts; } diff --git a/ttxtsubsdisplayer.c b/ttxtsubsdisplayer.c index 4b80858..074d672 100644 --- a/ttxtsubsdisplayer.c +++ b/ttxtsubsdisplayer.c @@ -237,7 +237,7 @@ void cTtxtSubsPlayer::SearchLanguagePage(uint8_t *p, int len) } } -bool cTtxtSubsPlayer::SetPreferredPage(const char* language, bool hearingImpaired, unsigned int bcdPage) +void cTtxtSubsPlayer::SetPreferredPage(const char* language, bool hearingImpaired, unsigned int bcdPage) { // Some French channels still send wrong subtitle page number! // This is a hard fix to change the page numbers 05x to 08x diff --git a/ttxtsubsdisplayer.h b/ttxtsubsdisplayer.h index 66f420a..c866b24 100644 --- a/ttxtsubsdisplayer.h +++ b/ttxtsubsdisplayer.h @@ -47,7 +47,7 @@ class cTtxtSubsPlayer : public cTtxtSubsDisplayer { private: void SearchLanguagePage(uint8_t *p, int len); - bool SetPreferredPage(const char* language, bool hearingImpaired, unsigned int bcdPage); + void SetPreferredPage(const char* language, bool hearingImpaired, unsigned int bcdPage); int mHasFilteredStream; int mFoundLangPage; |
