summaryrefslogtreecommitdiff
path: root/patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
diff options
context:
space:
mode:
authorTobias Grimm <git@e-tobi.net>2013-03-10 12:47:32 +0100
committerTobias Grimm <git@e-tobi.net>2013-03-10 13:14:05 +0100
commitf4204840f538e914541f43f23ce8bc94d3fc19aa (patch)
tree25ea9d7bd6ba927dc7e1ba8e3c6bb0a614387b6a /patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
parentc8d5d2f4aec922c001ff011f422317a228dcdde4 (diff)
downloadvdr-plugin-ttxtsubs-f4204840f538e914541f43f23ce8bc94d3fc19aa.tar.gz
vdr-plugin-ttxtsubs-f4204840f538e914541f43f23ce8bc94d3fc19aa.tar.bz2
Updated patch-set
Diffstat (limited to 'patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch')
-rw-r--r--patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch112
1 files changed, 112 insertions, 0 deletions
diff --git a/patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch b/patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
new file mode 100644
index 0000000..5c6879c
--- /dev/null
+++ b/patches/patch-set.1.7.38/0003-Allow-manual-configuration-of-teletetxt-subtitle-pag.patch
@@ -0,0 +1,112 @@
+From 81f20bc05af9fc4a6d79aeb028c2e3f2aad22685 Mon Sep 17 00:00:00 2001
+From: etobi <git@e-tobi.net>
+Date: Fri, 12 Feb 2010 21:56:41 +0100
+Subject: [PATCH 3/6] Allow manual configuration of teletetxt subtitle pages
+ in channels.conf
+
+---
+ channels.c | 39 ++++++++++++++++++++++++++++++++++++---
+ channels.h | 1 +
+ vdr.5 | 6 ++++++
+ 3 files changed, 43 insertions(+), 3 deletions(-)
+
+diff --git a/channels.c b/channels.c
+index 3eb31ce..a7f69a9 100644
+--- a/channels.c
++++ b/channels.c
+@@ -411,9 +411,9 @@ void cChannel::SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *Compos
+ void cChannel::SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages)
+ {
+ int mod = CHANNELMOD_NONE;
+- if (totalTtxtSubtitlePages != numberOfPages)
++ if (totalTtxtSubtitlePages != (fixedTtxtSubtitlePages + numberOfPages))
+ mod |= CHANNELMOD_PIDS;
+- totalTtxtSubtitlePages = 0;
++ totalTtxtSubtitlePages = fixedTtxtSubtitlePages;
+ for (int i = 0; (i < numberOfPages) && (totalTtxtSubtitlePages < MAXTXTPAGES); i++) {
+ if (teletextSubtitlePages[totalTtxtSubtitlePages].ttxtMagazine != pages[i].ttxtMagazine ||
+ teletextSubtitlePages[totalTtxtSubtitlePages].ttxtPage != pages[i].ttxtPage ||
+@@ -556,10 +556,17 @@ cString cChannel::ToText(const cChannel *Channel)
+ q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs, Channel->dtypes);
+ }
+ *q = 0;
+- const int TBufferSize = MAXSPIDS * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod', +10: paranoia and tpid
++ const int TBufferSize = (MAXTXTPAGES * MAXSPIDS) * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod', +10: paranoia and tpid
+ char tpidbuf[TBufferSize];
+ q = tpidbuf;
+ q += snprintf(q, sizeof(tpidbuf), "%d", Channel->tpid);
++ if (Channel->fixedTtxtSubtitlePages > 0) {
++ *q++ = '+';
++ for (int i = 0; i < Channel->fixedTtxtSubtitlePages; ++i) {
++ tTeletextSubtitlePage page = Channel->teletextSubtitlePages[i];
++ q += snprintf(q, sizeof(tpidbuf) - (q - tpidbuf), "%d=%s", page.PageNumber(), page.ttxtLanguage);
++ }
++ }
+ if (Channel->spids[0]) {
+ *q++ = ';';
+ q += IntArrayToString(q, Channel->spids, 10, Channel->slangs);
+@@ -730,6 +737,32 @@ bool cChannel::Parse(const char *s)
+ }
+ spids[NumSpids] = 0;
+ }
++ fixedTtxtSubtitlePages = 0;
++ if ((p = strchr(tpidbuf, '+')) != NULL) {
++ *p++ = 0;
++ char *q;
++ char *strtok_next;
++ while ((q = strtok_r(p, ",", &strtok_next)) != NULL) {
++ if (fixedTtxtSubtitlePages < MAXTXTPAGES) {
++ int page;
++ char *l = strchr(q, '=');
++ if (l)
++ *l++ = 0;
++ if (sscanf(q, "%d", &page) == 1) {
++ teletextSubtitlePages[fixedTtxtSubtitlePages] = tTeletextSubtitlePage(page);
++ if (l)
++ strn0cpy(teletextSubtitlePages[fixedTtxtSubtitlePages].ttxtLanguage, l, MAXLANGCODE2);
++ fixedTtxtSubtitlePages++;
++ }
++ else
++ esyslog("ERROR: invalid Teletext page!"); // no need to set ok to 'false'
++ }
++ else
++ esyslog("ERROR: too many Teletext pages!"); // no need to set ok to 'false'
++ p = NULL;
++ }
++ totalTtxtSubtitlePages = fixedTtxtSubtitlePages;
++ }
+ if (sscanf(tpidbuf, "%d", &tpid) != 1)
+ return false;
+ if (caidbuf) {
+diff --git a/channels.h b/channels.h
+index dbdcb17..b407672 100644
+--- a/channels.h
++++ b/channels.h
+@@ -126,6 +126,7 @@ private:
+ uint16_t compositionPageIds[MAXSPIDS];
+ uint16_t ancillaryPageIds[MAXSPIDS];
+ int tpid;
++ int fixedTtxtSubtitlePages;
+ int totalTtxtSubtitlePages;
+ tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES];
+ int caids[MAXCAIDS + 1]; // list is zero-terminated
+diff --git a/vdr.5 b/vdr.5
+index 4003a5e..cb1552d 100644
+--- a/vdr.5
++++ b/vdr.5
+@@ -233,6 +233,12 @@ by an '=' sign, as in
+
+ .B ...:201;2001=deu,2002=eng:...
+
++Manual teletext subtitling pages can be defined separated by a '+' sign.
++The pages (separated by commas) can contain language codes, delimited by a '='
++sign, as in
++
++.B ...:201+150=deu,151=fin;2001,2002:...
++
+ .TP
+ .B Conditional access
+ A hexadecimal integer defining how this channel can be accessed:
+--
+1.7.10.4
+