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 --- HISTORY | 2 ++ PLUGINS.html | 27 +++++++++++++-------------- device.c | 13 +++++++++---- device.h | 4 +++- dvbdevice.c | 7 ++++++- dvbdevice.h | 3 ++- 6 files changed, 35 insertions(+), 21 deletions(-) diff --git a/HISTORY b/HISTORY index 2fa1f755..429da3b4 100644 --- a/HISTORY +++ b/HISTORY @@ -1642,3 +1642,5 @@ Video Disk Recorder Revision History - Fixed a ternary expression in dvbspu.c. - Fixed handling 'Transfer Mode' on single device systems when recording an encrypted channel (thanks to Stefan Huelswitt). +- Fixed blocking replaying in case an encrypted channel is being recorded on + the primary device. diff --git a/PLUGINS.html b/PLUGINS.html index 991092ee..786d8c50 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -21,18 +21,18 @@ VDR program and present itself to the user. The inside interface provides the plugin code access to VDR's internal data structures and allows it to hook itself into specific areas to perform special actions.

-
  -Important modifications introduced in version 1.1.9 are marked like this. -
-
  +
  Important modifications introduced in version 1.1.11 are marked like this.
-
  +
  Important modifications introduced in version 1.1.12 are marked like this.
-
  +
  Important modifications introduced in version 1.1.13 are marked like this.
+
  +Important modifications introduced in version 1.1.14 are marked like this. +

Part I - The Outside Interface

@@ -964,7 +964,7 @@ bool DevicePoll(cPoller &Poller, int TimeoutMs = 0);

to determine whether the device is ready for further data. -
  +
 

If the player can provide more than a single audio track, it can implement the following functions to make them available: @@ -1194,9 +1194,8 @@ the cDvbDevice, which is used to access the DVB PCI cards. If the new device can receive, it most likely needs to provide a way of selecting which channel it shall tune to: -
 


-
  +
  virtual bool ProvidesSource(int Source) const;
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL); @@ -1206,8 +1205,7 @@ virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView); These functions will be called with the desired source or channel and shall return whether this device can provide the requested source or channel and whether tuning to it was successful, repectively. -
-
  +
 

Audio selection

@@ -1230,9 +1228,7 @@ A device that can be used for recording must implement the functions virtual bool SetPid(cPidHandle *Handle, int Type, bool On); virtual bool OpenDvr(void); virtual void CloseDvr(void); -
  virtual bool GetTSPacket(uchar *&Data); -

which allow VDR to set the PIDs that shall be recorded, set up the device for @@ -1256,6 +1252,9 @@ The functions to implement replaying capabilites are


virtual bool HasDecoder(void) const; +
  +virtual bool CanReplay(void) const; +
virtual bool SetPlayMode(ePlayMode PlayMode); virtual void TrickSpeed(int Speed); virtual void Clear(void); @@ -1315,7 +1314,7 @@ shut down (delete) all devices when the program terminates. It is therefore important that the devices are created on the heap, using the new operator! -
  +
 

Remote Control

The joy of zapping!

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; diff --git a/device.h b/device.h index f4744d71..1070c52f 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 1.24 2002/10/26 09:35:20 kls Exp $ + * $Id: device.h 1.25 2002/10/26 11:33:42 kls Exp $ */ #ifndef __DEVICE_H @@ -278,6 +278,8 @@ private: cPlayer *player; bool playerDetached; protected: + virtual bool CanReplay(void) const; + // Returns true if this device can currently start a replay session. virtual bool SetPlayMode(ePlayMode PlayMode); // Sets the device into the given play mode. // Returns true if the operation was successful. diff --git a/dvbdevice.c b/dvbdevice.c index cbd20e5a..a1a8913d 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.29 2002/10/26 11:11:42 kls Exp $ + * $Id: dvbdevice.c 1.30 2002/10/26 11:37:03 kls Exp $ */ #include "dvbdevice.h" @@ -802,6 +802,11 @@ void cDvbDevice::SetAudioTrackDevice(int Index) } } +bool cDvbDevice::CanReplay(void) const +{ + return cDevice::CanReplay() && !Ca(); // we can only replay if there is no Ca recording going on +} + bool cDvbDevice::SetPlayMode(ePlayMode PlayMode) { if (PlayMode != pmExtern_THIS_SHOULD_BE_AVOIDED && fd_video < 0 && fd_audio < 0) { diff --git a/dvbdevice.h b/dvbdevice.h index b5484dc7..8784c74e 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 1.14 2002/10/12 11:15:39 kls Exp $ + * $Id: dvbdevice.h 1.15 2002/10/26 11:35:04 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -101,6 +101,7 @@ private: protected: ePlayMode playMode; + virtual bool CanReplay(void) const; virtual bool SetPlayMode(ePlayMode PlayMode); public: virtual void TrickSpeed(int Speed); -- cgit v1.2.3