From 41320eca4d534aa803f0aeab1258965aa937752e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 26 Oct 2002 11:51:37 +0200 Subject: Fixed blocking replaying in case an encrypted channel is being recorded on the primary device --- device.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'device.c') diff --git a/device.c b/device.c index 2b9d2ee6..2d3d1d9e 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.31 2002/10/26 10:23:20 kls Exp $ + * $Id: device.c 1.32 2002/10/26 11:43:52 kls Exp $ */ #include "device.h" @@ -324,7 +324,7 @@ bool cDevice::SwitchChannel(int Direction) cChannel *channel; while ((channel = Channels.GetByNumber(n, Direction)) != NULL) { // try only channels which are currently available - if (PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit) || GetDevice(channel, 0)) + if (PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit) || PrimaryDevice()->CanReplay() && GetDevice(channel, 0)) break; n = channel->Number() + Direction; } @@ -360,7 +360,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView) if (NeedsTransferMode) { cDevice *CaDevice = GetDevice(Channel, 0); - if (CaDevice) { + if (CaDevice && CanReplay()) { cStatus::MsgChannelSwitch(this, 0); // only report status if we are actually going to switch the channel if (CaDevice->SetChannel(Channel, false) == scrOk) // calling SetChannel() directly, not SwitchChannel()! cControl::Launch(new cTransferControl(CaDevice, Channel->Vpid(), Channel->Apid1(), Channel->Apid2(), Channel->Dpid1(), Channel->Dpid2()));//XXX+ @@ -446,6 +446,11 @@ void cDevice::SetAudioTrack(int Index) SetAudioTrackDevice(Index); } +bool cDevice::CanReplay(void) const +{ + return HasDecoder(); +} + bool cDevice::SetPlayMode(ePlayMode PlayMode) { return false; @@ -482,7 +487,7 @@ bool cDevice::Replaying(void) const bool cDevice::AttachPlayer(cPlayer *Player) { - if (HasDecoder()) { + if (CanReplay()) { if (player) Detach(player); player = Player; -- cgit v1.2.3