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

Attempting to stay on the current channel in case of an upcoming recording

This commit is contained in:
Klaus Schmidinger 2008-02-23 13:19:10 +01:00
parent 1b1267674f
commit edfe582941
4 changed files with 18 additions and 4 deletions

View File

@ -5657,3 +5657,6 @@ Video Disk Recorder Revision History
to Ludwig Nussel for pointing this out).
- Revised the fix of calculating the scrollbar height in the skins. The scrollbar
handle now always has a height that is at least the width of the scrollbar.
- When switching the device that's used for live viewing away from the current
transponder in favor of an upcoming recording, an attempt is now made to stay
on the current channel by possibly going into 'Transfer Mode'.

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.154 2008/02/17 15:55:06 kls Exp $
* $Id: device.c 1.155 2008/02/23 13:09:01 kls Exp $
*/
#include "device.h"
@ -218,6 +218,7 @@ int cDevice::nextCardIndex = 0;
int cDevice::currentChannel = 1;
cDevice *cDevice::device[MAXDEVICES] = { NULL };
cDevice *cDevice::primaryDevice = NULL;
cDevice *cDevice::avoidDevice = NULL;
cDevice::cDevice(void)
{
@ -356,6 +357,8 @@ cDevice *cDevice::GetDevice(int Index)
cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView)
{
cDevice *AvoidDevice = avoidDevice;
avoidDevice = NULL;
// Collect the current priorities of all CAM slots that can decrypt the channel:
int NumCamSlots = CamSlots.Count();
int SlotPriority[NumCamSlots];
@ -385,6 +388,8 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
if (NumUsableSlots && SlotPriority[j] > MAXPRIORITY)
continue; // there is no CAM available in this slot
for (int i = 0; i < numDevices; i++) {
if (device[i] == AvoidDevice)
continue; // this device shall be temporarily avoided
if (Channel->Ca() && Channel->Ca() <= CA_DVB_MAX && Channel->Ca() != device[i]->CardIndex() + 1)
continue; // a specific card was requested, but not this one
if (NumUsableSlots && !CamSlots.Get(j)->Assign(device[i], true))

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.90 2008/02/16 13:50:11 kls Exp $
* $Id: device.h 1.91 2008/02/23 13:13:04 kls Exp $
*/
#ifndef __DEVICE_H
@ -101,6 +101,7 @@ private:
static int useDevice;
static cDevice *device[MAXDEVICES];
static cDevice *primaryDevice;
static cDevice *avoidDevice;
public:
static int NumDevices(void) { return numDevices; }
///< Returns the total number of devices.
@ -145,6 +146,9 @@ public:
///< this device/CAM combination will be skipped in the next call to
///< GetDevice().
///< See also ProvidesChannel().
static void SetAvoidDevice(cDevice *Device) { avoidDevice = Device; }
///< Sets the given Device to be temporarily avoided in the next call to
///< GetDevice(const cChannel, int, bool).
static void Shutdown(void);
///< Closes down all devices.
///< Must be called at the end of the program.

6
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
* $Id: vdr.c 1.310 2008/02/10 14:23:31 kls Exp $
* $Id: vdr.c 1.311 2008/02/23 13:19:10 kls Exp $
*/
#include <getopt.h>
@ -877,7 +877,9 @@ int main(int argc, char *argv[])
}
if (cDevice::PrimaryDevice()->HasDecoder() && !cDevice::PrimaryDevice()->HasProgramme()) {
// the previous SwitchChannel() has switched away the current live channel
Channels.SwitchTo(Timer->Channel()->Number()); // avoids toggling between old channel and black screen
cDevice::SetAvoidDevice(Device);
if (!Channels.SwitchTo(cDevice::CurrentChannel())) // try to switch to the original channel on a different device...
Channels.SwitchTo(Timer->Channel()->Number()); // ...or avoid toggling between old channel and black screen
Skins.Message(mtInfo, tr("Upcoming recording!"));
}
}