Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > da95e7e5c21cf72a778ff56c7941399c > files > 6

vdr-1.6.0-4mdv2008.0.src.rpm

diff -ubw vdr-1.5.5/device.h vdr-1.5.5-Rotor/device.h
--- vdr-1.5.5/device.h	2007-01-13 12:33:57.000000000 +0100
+++ vdr-1.5.5-Rotor/device.h	2007-06-30 21:27:45.000000000 +0200
@@ -22,6 +22,7 @@
 #include "spu.h"
 #include "thread.h"
 #include "tools.h"
+#include <linux/dvb/frontend.h>
 
 #define MAXDEVICES         16 // the maximum number of devices in the system
 #define MAXPIDHANDLES      64 // the maximum number of different PIDs per device
@@ -256,6 +257,7 @@
   virtual bool HasProgramme(void);
          ///< Returns true if the device is currently showing any programme to
          ///< the user, either through replaying or live.
+  virtual bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd) {return false;}
 
 // PID handle facilities
 
diff -ubw vdr-1.5.5/dvbdevice.c vdr-1.5.5-Rotor/dvbdevice.c
--- vdr-1.5.5/dvbdevice.c	2007-02-25 12:46:52.000000000 +0100
+++ vdr-1.5.5-Rotor/dvbdevice.c	2007-06-30 21:28:47.000000000 +0200
@@ -71,6 +71,7 @@
 class cDvbTuner : public cThread {
 private:
   enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
+ bool SendDiseqc;
   int fd_frontend;
   int cardIndex;
   int tuneTimeout;
@@ -83,6 +84,7 @@
   cMutex mutex;
   cCondVar locked;
   cCondVar newSet;
+  dvb_diseqc_master_cmd diseqc_cmd;
   bool GetFrontendStatus(fe_status_t &Status, int TimeoutMs = 0);
   bool SetFrontend(void);
   virtual void Action(void);
@@ -91,12 +93,14 @@
   virtual ~cDvbTuner();
   bool IsTunedTo(const cChannel *Channel) const;
   void Set(const cChannel *Channel, bool Tune);
+  bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd);
   bool Locked(int TimeoutMs = 0);
   };
 
 cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_type_t FrontendType)
 {
   fd_frontend = Fd_Frontend;
+  SendDiseqc=false;
   cardIndex = CardIndex;
   frontendType = FrontendType;
   tuneTimeout = 0;
@@ -145,6 +149,17 @@
   return tunerStatus >= tsLocked;
 }
 
+bool cDvbTuner::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
+{
+  cMutexLock MutexLock(&mutex);
+  if (frontendType!=FE_QPSK || SendDiseqc)
+    return false;
+  diseqc_cmd=cmd;
+  SendDiseqc=true;
+  newSet.Broadcast();
+  return true;
+}
+
 bool cDvbTuner::GetFrontendStatus(fe_status_t &Status, int TimeoutMs)
 {
   if (TimeoutMs) {
@@ -297,6 +312,10 @@
         if (GetFrontendStatus(NewStatus, 10))
            Status = NewStatus;
         cMutexLock MutexLock(&mutex);
+        if (SendDiseqc) {
+           CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &diseqc_cmd));
+           SendDiseqc=false;
+           }
         switch (tunerStatus) {
           case tsIdle:
                break;
@@ -858,6 +877,11 @@
   return dvbTuner ? dvbTuner->Locked(TimeoutMs) : false;
 }
 
+bool cDvbDevice::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
+{
+  return dvbTuner->SendDiseqcCmd(cmd);
+}
+
 int cDvbDevice::GetAudioChannelDevice(void)
 {
   if (HasDecoder()) {
Nur in vdr-1.5.5-Rotor/: dvbdevice.c.rej.
diff -ubw vdr-1.5.5/dvbdevice.h vdr-1.5.5-Rotor/dvbdevice.h
--- vdr-1.5.5/dvbdevice.h	2007-02-25 13:23:57.000000000 +0100
+++ vdr-1.5.5-Rotor/dvbdevice.h	2007-06-30 21:27:45.000000000 +0200
@@ -71,6 +71,7 @@
   virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
 public:
   virtual bool HasLock(int TimeoutMs = 0);
+  virtual bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd);
 
 // PID handle facilities