The EPG scan no longer disturbs players that have also set live PIDs

This commit is contained in:
Klaus Schmidinger 2005-11-05 15:48:05 +01:00
parent 596e965a53
commit 27ab07e80d
5 changed files with 22 additions and 9 deletions

View File

@ -203,6 +203,8 @@ Stefan Huelswitt <huels@iname.com>
for pointing out that recordings with empty episode names were not listed correctly for pointing out that recordings with empty episode names were not listed correctly
in the LSTR command in the LSTR command
for fixing a memory leak in the SVDRP command LSTE for fixing a memory leak in the SVDRP command LSTE
for reporting a problem with the EPG scan disturbing players that have also set
live PIDs
Ulrich Röder <roeder@efr-net.de> Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than 27500 for pointing out that there are channels that have a symbol rate higher than 27500

View File

@ -3934,3 +3934,5 @@ Video Disk Recorder Revision History
been removed. If a plugin has used that macro, it should either define been removed. If a plugin has used that macro, it should either define
a buffer size of its own, or use cReadLine when reading files. a buffer size of its own, or use cReadLine when reading files.
- Fixed a race condition in the SPU decoder (thanks to Marco Schlüßler). - Fixed a race condition in the SPU decoder (thanks to Marco Schlüßler).
- The EPG scan no longer disturbs players that have also set live PIDs
(reported by Stefan Huelswitt).

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.110 2005/09/17 14:29:44 kls Exp $ * $Id: device.c 1.111 2005/11/05 15:23:58 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -514,6 +514,11 @@ bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Needs
return false; return false;
} }
bool cDevice::MaySwitchTransponder(void)
{
return !Receiving(true) && !(pidHandles[ptAudio].pid || pidHandles[ptVideo].pid || pidHandles[ptDolby].pid);
}
bool cDevice::SwitchChannel(const cChannel *Channel, bool LiveView) bool cDevice::SwitchChannel(const cChannel *Channel, bool LiveView)
{ {
if (LiveView) if (LiveView)

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.65 2005/09/17 14:29:28 kls Exp $ * $Id: device.h 1.66 2005/11/05 15:25:41 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -215,6 +215,9 @@ public:
///< function itself actually returns true. ///< function itself actually returns true.
///< The default implementation always returns false, so a derived cDevice ///< The default implementation always returns false, so a derived cDevice
///< class that can provide channels must implement this function. ///< class that can provide channels must implement this function.
virtual bool MaySwitchTransponder(void);
///< Returns true if it is ok to switch the transponder on this device,
///< without disturbing any other activities.
bool SwitchChannel(const cChannel *Channel, bool LiveView); bool SwitchChannel(const cChannel *Channel, bool LiveView);
///< Switches the device to the given Channel, initiating transfer mode ///< Switches the device to the given Channel, initiating transfer mode
///< if necessary. ///< if necessary.

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: eitscan.c 1.28 2005/08/26 15:37:06 kls Exp $ * $Id: eitscan.c 1.29 2005/11/05 15:24:36 kls Exp $
*/ */
#include "eitscan.h" #include "eitscan.h"
@ -150,13 +150,14 @@ void cEITScanner::Process(void)
if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) { if (!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) {
if (Device->ProvidesTransponder(Channel)) { if (Device->ProvidesTransponder(Channel)) {
if (!Device->Receiving()) { if (!Device->Receiving()) {
bool IsPrimaryDeviceReplaying = Device == cDevice::PrimaryDevice() && Device->Replaying() && cTransferControl::ReceiverDevice() != cDevice::PrimaryDevice(); bool MaySwitchTransponder = Device->MaySwitchTransponder();
if (Device != cDevice::ActualDevice() || (Device->ProvidesTransponderExclusively(Channel) && (IsPrimaryDeviceReplaying || now - lastActivity > Setup.EPGScanTimeout * 3600))) { if (MaySwitchTransponder || Device->ProvidesTransponderExclusively(Channel) && now - lastActivity > Setup.EPGScanTimeout * 3600) {
if (!IsPrimaryDeviceReplaying && Device == cDevice::ActualDevice() && !currentChannel) { if (!MaySwitchTransponder) {
if (cTransferControl::ReceiverDevice()) if (Device == cDevice::ActualDevice() && !currentChannel) {
cDevice::PrimaryDevice()->StopReplay(); // stop transfer mode cDevice::PrimaryDevice()->StopReplay(); // stop transfer mode
currentChannel = Device->CurrentChannel(); currentChannel = Device->CurrentChannel();
Skins.Message(mtInfo, tr("Starting EPG scan")); Skins.Message(mtInfo, tr("Starting EPG scan"));
}
} }
currentDevice = Device;//XXX see also dvbdevice.c!!! currentDevice = Device;//XXX see also dvbdevice.c!!!
//dsyslog("EIT scan: device %d source %-8s tp %5d", Device->DeviceNumber() + 1, *cSource::ToString(Channel->Source()), Channel->Transponder()); //dsyslog("EIT scan: device %d source %-8s tp %5d", Device->DeviceNumber() + 1, *cSource::ToString(Channel->Source()), Channel->Transponder());