From 8570cc5326dbc40650c4a84b4b486be8fef36110 Mon Sep 17 00:00:00 2001 From: etobi Date: Sat, 6 Nov 2010 16:14:34 +0100 Subject: Don't care if the current channel really changed, if we get a channel switch on the primary device. After playback when the txtreceiver wass detached, the txtreciver might not get started again, because the channel hasn't changed even if the device got a channel switch message. --- HISTORY | 2 ++ txtrecv.c | 11 ++--------- txtrecv.h | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/HISTORY b/HISTORY index 2fde612..f1a83c7 100644 --- a/HISTORY +++ b/HISTORY @@ -10,6 +10,8 @@ VDR Plugin 'osdteletext' Revision History - Added command line option to enable storing TopText pages, which is now disabled by default (References #177) (Thx to Andreas Brachold!) - Makefile adjustments for VDR 1.7.13. +- Don't care if the current channel really changed, if we get a channel switch + on the primary device (Thx to Sören Moch) 2009-06-02: version 0.8.3 - Updated Ukrainian translation provided by Yarema P. aka Knedlyk (Closes #133) diff --git a/txtrecv.c b/txtrecv.c index ac27c4c..c6df703 100644 --- a/txtrecv.c +++ b/txtrecv.c @@ -476,7 +476,6 @@ cTxtStatus::cTxtStatus(bool storeTopText, Storage* storage) :storeTopText(storeTopText), storage(storage) { receiver = NULL; - currentLiveChannel = tChannelID::InvalidID; } cTxtStatus::~cTxtStatus() @@ -494,26 +493,20 @@ void cTxtStatus::ChannelSwitch(const cDevice *Device, int ChannelNumber) cChannel* newLiveChannel = Channels.GetByNumber(ChannelNumber); if (newLiveChannel == NULL) return; - // ignore if channel hasn't changed - if (currentLiveChannel == newLiveChannel->GetChannelID()) return; - // ignore non-live-channel-switching if (!Device->IsPrimaryDevice() || ChannelNumber != cDevice::CurrentChannel()) return; - // At this point it seems to be pretty sure to me, that the live - // channel was changed to a new channel and OSDTeletext can + // live channel was changed // now re-attach the receiver to the new live channel - currentLiveChannel = newLiveChannel->GetChannelID(); - delete receiver; receiver = NULL; int TPid = newLiveChannel->Tpid(); if (TPid) { - receiver = new cTxtReceiver(TPid, currentLiveChannel, storeTopText, storage); + receiver = new cTxtReceiver(TPid, newLiveChannel->GetChannelID(), storeTopText, storage); cDevice::ActualDevice()->AttachReceiver(receiver); } diff --git a/txtrecv.h b/txtrecv.h index 0d2614d..95deab5 100644 --- a/txtrecv.h +++ b/txtrecv.h @@ -173,7 +173,6 @@ public: class cTxtStatus : public cStatus { private: cTxtReceiver *receiver; - tChannelID currentLiveChannel; bool storeTopText; Storage* storage; protected: -- cgit v1.2.3