From 886bdaa2fc4677a5ed2ecb6aeb67424198e27934 Mon Sep 17 00:00:00 2001 From: Tobias Grimm Date: Tue, 2 Dec 2008 22:37:17 +0100 Subject: Fixed problems when switching channels on FF+Budget systems See: http://www.vdr-portal.de/board/thread.php?postid=728192#post728192 --- txtrecv.c | 16 ++++++++++++---- txtrecv.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/txtrecv.c b/txtrecv.c index e7898e1..73ba499 100644 --- a/txtrecv.c +++ b/txtrecv.c @@ -521,12 +521,15 @@ cTxtStatus::~cTxtStatus() /*if (running) Cancel(3);*/ if (receiver) + { + receiver->Stop(); delete receiver; + } } void cTxtStatus::ChannelSwitch(const cDevice *Device, int ChannelNumber) { - if (Device->IsPrimaryDevice()) { + if (Device->IsPrimaryDevice() || Device == cDevice::ActualDevice()) { /*#ifdef OSDTELETEXT_REINSERTION_PATCH if (ttSetup.suspendReceiving) { @@ -563,9 +566,9 @@ void cTxtStatus::CheckCreateReceiver() { if (!channel) return; //primary device a full-featured card - if (cDevice::PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit)) { + if (cDevice::ActualDevice()->ProvidesChannel(channel, Setup.PrimaryLimit)) { receiver = new cTxtReceiver(TPid, chan); - cDevice::PrimaryDevice()->AttachReceiver(receiver); + cDevice::ActualDevice()->AttachReceiver(receiver); //dsyslog("OSDTeletext: Created teletext receiver for channel %d, PID %d on primary device", ChNum, TPid); //primary device a DXR3 or similar } else { @@ -710,7 +713,7 @@ cTxtReceiver::cTxtReceiver(int TPid, tChannelID chan) cTxtReceiver::~cTxtReceiver() { - Detach(); + cReceiver::Detach(); if (running) { running=false; buffer.Signal(); @@ -720,6 +723,11 @@ cTxtReceiver::~cTxtReceiver() delete TxtPage; } +void cTxtReceiver::Stop() +{ + Activate(false); +} + void cTxtReceiver::Activate(bool On) { if (On) { diff --git a/txtrecv.h b/txtrecv.h index cafb1dd..927350d 100644 --- a/txtrecv.h +++ b/txtrecv.h @@ -175,6 +175,7 @@ protected: public: cTxtReceiver(int TPid, tChannelID chan); virtual ~cTxtReceiver(); + virtual void Stop(); }; class cTxtStatus : public cStatus/*, public cThread*/ { -- cgit v1.2.3