1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Restoring the current channel in case a recording has switched the transponder

This commit is contained in:
Klaus Schmidinger 2003-05-03 13:42:37 +02:00
parent 201364cd8a
commit 3fc00d2211
4 changed files with 25 additions and 21 deletions

View File

@ -2085,10 +2085,10 @@ Video Disk Recorder Revision History
usage (thanks to Thomas Koch). usage (thanks to Thomas Koch).
- Fixed faulty calculation of section length in eit.c (thanks to Teemu Rantanen). - Fixed faulty calculation of section length in eit.c (thanks to Teemu Rantanen).
2003-05-01: Version 1.1.30 2003-05-03: Version 1.1.30
- Fixed minimum lifespan of deleted recordings (thanks to Jaakko Hyvätti). - Fixed minimum lifespan of deleted recordings (thanks to Jaakko Hyvätti).
- Updated French OSD texts (thanks to Olivier Jacques <jacquesolivier@hotmail.com>). - Updated French OSD texts (thanks to Olivier Jacques).
- Fixed paging through lists with repeated Left/Right keys. - Fixed paging through lists with repeated Left/Right keys.
- Fixed setting the PCR-PID in case it is equal to one of the other PIDs (thanks - Fixed setting the PCR-PID in case it is equal to one of the other PIDs (thanks
to Oliver Endriss for reporting this one). to Oliver Endriss for reporting this one).
@ -2100,3 +2100,6 @@ Video Disk Recorder Revision History
replay continue even if a recording is started on the primary device. replay continue even if a recording is started on the primary device.
- The RCU channel display no longer changes when a recording on a different - The RCU channel display no longer changes when a recording on a different
channel starts on the primary device. channel starts on the primary device.
- Restoring the current channel in case a recording has switched the transponder.
If all devices are busy and none of them can provide the current channel, the
message "Channel not available!" will be displayed.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 1.40 2003/05/02 09:18:42 kls Exp $ * $Id: device.c 1.41 2003/05/03 13:40:15 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -50,8 +50,6 @@ cDevice::cDevice(void)
ciHandler = NULL; ciHandler = NULL;
player = NULL; player = NULL;
playerDetached = false;
for (int i = 0; i < MAXRECEIVERS; i++) for (int i = 0; i < MAXRECEIVERS; i++)
receiver[i] = NULL; receiver[i] = NULL;
@ -122,13 +120,6 @@ bool cDevice::HasDecoder(void) const
return false; return false;
} }
bool cDevice::PlayerDetached(void)
{
bool result = playerDetached;
playerDetached = false;
return result;
}
cOsdBase *cDevice::NewOsd(int x, int y) cOsdBase *cDevice::NewOsd(int x, int y)
{ {
return NULL; return NULL;
@ -408,6 +399,11 @@ bool cDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
return false; return false;
} }
bool cDevice::HasProgramme(void)
{
return Replaying() || pidHandles[ptAudio].pid || pidHandles[ptVideo].pid;
}
void cDevice::SetVolumeDevice(int Volume) void cDevice::SetVolumeDevice(int Volume)
{ {
} }
@ -536,7 +532,6 @@ void cDevice::Detach(cPlayer *Player)
player->device = NULL; player->device = NULL;
player = NULL; player = NULL;
SetPlayMode(pmNone); SetPlayMode(pmNone);
playerDetached = true;
Audios.ClearAudio(); Audios.ClearAudio();
} }
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.h 1.31 2003/05/02 08:21:05 kls Exp $ * $Id: device.h 1.32 2003/05/03 13:35:55 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -181,6 +181,9 @@ protected:
public: public:
static int CurrentChannel(void) { return primaryDevice ? currentChannel : 0; } static int CurrentChannel(void) { return primaryDevice ? currentChannel : 0; }
///< Returns the number of the current channel on the primary device. ///< Returns the number of the current channel on the primary device.
virtual bool HasProgramme(void);
///< Returns true if the device is currently showing any programme to
///< the user, either through replaying or live.
// PID handle facilities // PID handle facilities
@ -300,7 +303,6 @@ public:
private: private:
cPlayer *player; cPlayer *player;
bool playerDetached;
protected: protected:
virtual bool CanReplay(void) const; virtual bool CanReplay(void) const;
///< Returns true if this device can currently start a replay session. ///< Returns true if this device can currently start a replay session.
@ -349,8 +351,6 @@ public:
///< Attaches the given player to this device. ///< Attaches the given player to this device.
void Detach(cPlayer *Player); void Detach(cPlayer *Player);
///< Detaches the given player from this device. ///< Detaches the given player from this device.
bool PlayerDetached(void);
///< Returns true if a player has been detached and resets the 'playerDetached' flag.
// Receiver facilities // Receiver facilities

14
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.151 2003/05/02 10:59:07 kls Exp $ * $Id: vdr.c 1.152 2003/05/03 13:39:57 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -53,6 +53,7 @@
#include "tools.h" #include "tools.h"
#include "videodir.h" #include "videodir.h"
#define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown #define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown
#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start #define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start
@ -460,9 +461,14 @@ int main(int argc, char *argv[])
} }
// Attach launched player control: // Attach launched player control:
cControl::Attach(); cControl::Attach();
// Make sure Transfer-Mode is re-started after detaching a player: // Make sure we have a visible programme in case device usage has changed:
if (cDevice::PrimaryDevice()->PlayerDetached() && !cDevice::PrimaryDevice()->Replaying()) if (!cDevice::PrimaryDevice()->HasProgramme()) {
Channels.SwitchTo(cDevice::CurrentChannel()); static time_t lastTime = 0;
if (time(NULL) - lastTime > MINCHANNELWAIT) {
if (!Channels.SwitchTo(cDevice::CurrentChannel()))
lastTime = time(NULL); // don't do this too often
}
}
// Restart the Watchdog timer: // Restart the Watchdog timer:
if (WatchdogTimeout > 0) { if (WatchdogTimeout > 0) {
int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout); int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout);