summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--txtrecv.c16
-rw-r--r--txtrecv.h1
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*/ {