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).
- 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).
- 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 setting the PCR-PID in case it is equal to one of the other PIDs (thanks
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.
- The RCU channel display no longer changes when a recording on a different
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
* 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"
@ -50,8 +50,6 @@ cDevice::cDevice(void)
ciHandler = NULL;
player = NULL;
playerDetached = false;
for (int i = 0; i < MAXRECEIVERS; i++)
receiver[i] = NULL;
@ -122,13 +120,6 @@ bool cDevice::HasDecoder(void) const
return false;
}
bool cDevice::PlayerDetached(void)
{
bool result = playerDetached;
playerDetached = false;
return result;
}
cOsdBase *cDevice::NewOsd(int x, int y)
{
return NULL;
@ -408,6 +399,11 @@ bool cDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
return false;
}
bool cDevice::HasProgramme(void)
{
return Replaying() || pidHandles[ptAudio].pid || pidHandles[ptVideo].pid;
}
void cDevice::SetVolumeDevice(int Volume)
{
}
@ -536,7 +532,6 @@ void cDevice::Detach(cPlayer *Player)
player->device = NULL;
player = NULL;
SetPlayMode(pmNone);
playerDetached = true;
Audios.ClearAudio();
}
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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
@ -181,6 +181,9 @@ protected:
public:
static int CurrentChannel(void) { return primaryDevice ? currentChannel : 0; }
///< 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
@ -300,7 +303,6 @@ public:
private:
cPlayer *player;
bool playerDetached;
protected:
virtual bool CanReplay(void) const;
///< Returns true if this device can currently start a replay session.
@ -349,8 +351,6 @@ public:
///< Attaches the given player to this device.
void Detach(cPlayer *Player);
///< 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

14
vdr.c
View File

@ -22,7 +22,7 @@
*
* 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>
@ -53,6 +53,7 @@
#include "tools.h"
#include "videodir.h"
#define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
#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
@ -460,9 +461,14 @@ int main(int argc, char *argv[])
}
// Attach launched player control:
cControl::Attach();
// Make sure Transfer-Mode is re-started after detaching a player:
if (cDevice::PrimaryDevice()->PlayerDetached() && !cDevice::PrimaryDevice()->Replaying())
Channels.SwitchTo(cDevice::CurrentChannel());
// Make sure we have a visible programme in case device usage has changed:
if (!cDevice::PrimaryDevice()->HasProgramme()) {
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:
if (WatchdogTimeout > 0) {
int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout);