summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Grimm <git@e-tobi.net>2010-02-03 20:53:03 +0100
committerTobias Grimm <git@e-tobi.net>2010-02-04 23:26:20 +0100
commit5fd4b06b7d21b44eff6918dbcbba691870023ae7 (patch)
tree424b717c14ed584c2850b864d205aa21feac5623
parent3fe4cb0b34fbdd810777b14800f937eaf4cebc09 (diff)
downloadvdr-plugin-ttxtsubs-5fd4b06b7d21b44eff6918dbcbba691870023ae7.tar.gz
vdr-plugin-ttxtsubs-5fd4b06b7d21b44eff6918dbcbba691870023ae7.tar.bz2
Fixed replay when live ttxtsubs page differs from the one in the recording
(Closes #139) Thx to Rolf Ahrenberg!
-rw-r--r--HISTORY2
-rw-r--r--ttxtsubs.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/HISTORY b/HISTORY
index 156e391..2a4aa6c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6,6 +6,8 @@ VDR Plugin 'ttxtsubs' Revision History
- Updated VDR patch for 1.7.8
- Some code refactoring
- Updated plugin and VDR patch for 1.7.12 - Thx to Rolf Ahrenberg (Closes #236)
+- Fixed replay when the current live ttxtsubs page differs from the
+ one in the recording - Thx to Rolf Ahrenberg (Closes #139)
2009-04-26: Version 0.1.0
- Updated VDR patch and plugin to VDR 1.7.6 with support for the TS recording
diff --git a/ttxtsubs.c b/ttxtsubs.c
index bf6f1ed..bde2931 100644
--- a/ttxtsubs.c
+++ b/ttxtsubs.c
@@ -167,9 +167,8 @@ private:
char mOldLanguage[4]; // language chosen from previous version
int mOldHearingImpaired; // HI setting chosen from previous version
+ bool mReplay;
- // ugly hack for now
- int mPage;
// wait for channel switch
sem_t chswitchwait;
cMutex getchmutex;
@@ -201,7 +200,8 @@ class cMenuSetupTtxtsubs : public cMenuSetupPage {
cPluginTtxtsubs::cPluginTtxtsubs(void)
:
mDispl(NULL),
- mOldHearingImpaired(0)
+ mOldHearingImpaired(0),
+ mReplay(false)
{
// Initialize any member variables here.
// DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
@@ -404,7 +404,6 @@ void cPluginTtxtsubs::Action(void)
if (!geterror) {
if(FindSubs(&info, &pid, &page, lang)) {
//dprint("CHANNELSWITCH, pid: %d page: %x\n", pid, page);
- mPage = page; // XXX remember this for playback (temporary hack)!
for(int i = 0; i < gNumLanguages; i++) {
if(!memcmp(lang, gLanguages[i][0], 3) ||
!memcmp(lang, gLanguages[i][1], 3)) {
@@ -413,7 +412,10 @@ void cPluginTtxtsubs::Action(void)
}
if(globals.mI18nLanguage < 0 || globals.mI18nLanguage >= I18nLanguages()->Size())
globals.mI18nLanguage = 0; // default to iso8859-1 if no predefined charset
- StartTtxtLive(dev, c->GetChannelID(), pid, page);
+ if (mReplay)
+ StartTtxtPlay(page);
+ else
+ StartTtxtLive(dev, c->GetChannelID(), pid, page);
FreeTtxtInfoData(&info);
break;
} else { //!FindSubs
@@ -459,13 +461,9 @@ void cPluginTtxtsubs::ChannelSwitch(const cDevice *Device, int ChannelNumber)
void cPluginTtxtsubs::Replaying(const cControl *Control, const char *Name, const char *FileName, bool On)
{
//dprint("cPluginTtxtsubs::Replaying\n"); // XXX
- StopTtxt();
- if(On)
- StartTtxtPlay(mPage);
- else {
- lastc=0;
- sem_post(&chswitchwait);
- }
+ mReplay = On;
+ lastc=0;
+ sem_post(&chswitchwait);
}
void cPluginTtxtsubs::PlayerTeletextData(uint8_t *p, int length, bool IsPesRecording)