Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-release-src > by-pkgid > adc71b89727e16d9b88f5dd238a4d4c5 > files > 6

vdr-1.6.0-17mdv2010.1.src.rpm

diff -p -up vdr-1.6.0/device.h.orig vdr-1.6.0/device.h
--- vdr-1.6.0/device.h.orig	2009-03-20 23:59:31.000000000 +0200
+++ vdr-1.6.0/device.h	2009-03-20 23:59:31.000000000 +0200
@@ -23,6 +23,7 @@
 #include "spu.h"
 #include "thread.h"
 #include "tools.h"
+#include <linux/dvb/frontend.h>
 
 #define MAXPIDHANDLES      64 // the maximum number of different PIDs per device
 #define MAXRECEIVERS       16 // the maximum number of receivers per device
@@ -339,6 +340,7 @@ public:
   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 -p -up vdr-1.6.0/dvbdevice.c.orig vdr-1.6.0/dvbdevice.c
--- vdr-1.6.0/dvbdevice.c.orig	2009-03-20 23:59:31.000000000 +0200
+++ vdr-1.6.0/dvbdevice.c	2009-03-21 00:01:46.000000000 +0200
@@ -71,6 +71,7 @@ static int DvbOpen(const char *Name, int
 class cDvbTuner : public cThread {
 private:
   enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
+ bool SendDiseqc;
   int fd_frontend;
   int cardIndex;
   int tuneTimeout;
@@ -84,6 +85,7 @@ private:
   cMutex mutex;
   cCondVar locked;
   cCondVar newSet;
+  dvb_diseqc_master_cmd diseqc_cmd;
   bool SetFrontend(void);
   virtual void Action(void);
 public:
@@ -91,6 +93,7 @@ public:
   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);
   bool GetFrontendStatus(fe_status_t &Status, int TimeoutMs = 0);
   bool GetSignal(uint16_t &Signal, int TimeoutMs = 0);
@@ -104,6 +107,7 @@ cDvbTuner::cDvbTuner(int Fd_Frontend, in
 {
   struct dvb_frontend_info info;
   fd_frontend = Fd_Frontend;
+  SendDiseqc=false;
   cardIndex = CardIndex;
   frontendType = FrontendType;
   tuneTimeout = 0;
@@ -154,6 +158,17 @@ bool cDvbTuner::Locked(int TimeoutMs)
   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) {
@@ -382,6 +397,10 @@ void cDvbTuner::Action(void)
         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;
@@ -1054,6 +1073,11 @@ bool cDvbDevice::HasLock(int TimeoutMs)
   return dvbTuner ? dvbTuner->Locked(TimeoutMs) : false;
 }
 
+bool cDvbDevice::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
+{
+  return dvbTuner->SendDiseqcCmd(cmd);
+}
+
 int cDvbDevice::GetAudioChannelDevice(void)
 {
   if (HasDecoder()) {
diff -p -up vdr-1.6.0/dvbdevice.h.orig vdr-1.6.0/dvbdevice.h
--- vdr-1.6.0/dvbdevice.h.orig	2009-03-20 23:57:52.000000000 +0200
+++ vdr-1.6.0/dvbdevice.h	2009-03-20 23:59:31.000000000 +0200
@@ -85,6 +85,7 @@ protected:
   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