Merge pull request #145 from Dima73/tuner
authorMike Looijmans <milosoftware@users.noreply.github.com>
Mon, 28 Dec 2015 09:48:46 +0000 (10:48 +0100)
committerMike Looijmans <milosoftware@users.noreply.github.com>
Mon, 28 Dec 2015 09:48:46 +0000 (10:48 +0100)
frontend: correct snr/db value for tuner "Si216x" (dvb-t mode)

lib/base/filepush.cpp
lib/base/filepush.h
lib/dvb/dvb.cpp
lib/dvb/frontend.cpp

index 0d473d5..89fec89 100644 (file)
@@ -6,9 +6,7 @@
 
 //#define SHOW_WRITE_TIME
 
-eFilePushThread::eFilePushThread(int io_prio_class, int io_prio_level, int blocksize, size_t buffersize)
-       :prio_class(io_prio_class),
-        prio(io_prio_level),
+eFilePushThread::eFilePushThread(int blocksize, size_t buffersize):
         m_sg(NULL),
         m_stop(1),
         m_send_pvr_commit(0),
@@ -47,7 +45,7 @@ void eFilePushThread::thread()
 {
        ignore_but_report_signals();
        hasStarted(); /* "start()" blocks until we get here */
-       setIoPrio(prio_class, prio);
+       setIoPrio(IOPRIO_CLASS_BE, 0);
        eDebug("[eFilePushThread] START thread");
 
        do
index 22af20e..0f1fa54 100644 (file)
@@ -18,7 +18,7 @@ public:
 class eFilePushThread: public eThread, public Object
 {
 public:
-       eFilePushThread(int prio_class=IOPRIO_CLASS_BE, int prio_level=0, int blocksize=188, size_t buffersize=188*1024);
+       eFilePushThread(int blocksize, size_t buffersize);
        ~eFilePushThread();
        void thread();
        void stop();
@@ -40,8 +40,6 @@ public:
 protected:
        virtual void filterRecordData(const unsigned char *data, int len);
 private:
-       int prio_class;
-       int prio;
        iFilePushScatterGather *m_sg;
        int m_stop;
        int m_fd_dest;
@@ -65,7 +63,7 @@ private:
 class eFilePushThreadRecorder: public eThread, public Object
 {
 public:
-       eFilePushThreadRecorder(unsigned char* buffer, size_t buffersize=188*1024);
+       eFilePushThreadRecorder(unsigned char* buffer, size_t buffersize);
        void thread();
        void stop();
        void start(int sourcefd);
index c1ca2a2..4cb29f5 100644 (file)
@@ -858,24 +858,21 @@ alloc_fe_by_id_not_possible:
 
 RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int &cap)
 {
-       /* find first unused demux which is on same adapter as frontend (or any, if PVR)
-        * never use the first one unless we need a decoding demux.
-        * look for a demux on the same adapter as the frontend, or the first adapter for dvr playback
-        */
-       iDVBAdapter *adapter = fe ? fe->m_adapter : m_adapter.begin();
-       int fesource = fe ? fe->m_frontend->getDVBID() : -1;
-
        eDebug("[eDVBResourceManager] allocate demux cap=%02X", cap);
        eSmartPtrList<eDVBRegisteredDemux>::iterator i(m_demux.begin());
 
        if (i == m_demux.end())
                return -1;
 
+       iDVBAdapter *adapter = fe ? fe->m_adapter : m_adapter.begin();
+       int fesource = fe ? fe->m_frontend->getDVBID() : -1;
+       ePtr<eDVBRegisteredDemux> unused;
+       uint8_t d, a;
+
        /*
         * For pvr playback, start with the last demux.
-        * On some hardware, we have less ca devices than demuxes,
-        * so we should try to leave the first demuxes for live tv,
-        * and start with the last for pvr playback
+        * On some hardware, there are less ca devices than demuxes, so try to leave
+        * the first demuxes for live tv, and start with the last for pvr playback
         */
        bool use_decode_demux = (fe || (cap & iDVBChannel::capDecode));
 
@@ -885,21 +882,19 @@ RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBA
                --i;
        }
 
-       ePtr<eDVBRegisteredDemux> unused;
-       uint8_t d, a;
-
        while (i != m_demux.end())
        {
                if (i->m_adapter == adapter)
                {
                        if (!i->m_inuse)
                        {
-                               /* mark the first unused demux, we'll use that when we do not find a better match */
-                               if (!unused) unused = i;
+                               // mark the first unused demux and use that when no better match is found
+                               if (!unused)
+                                       unused = i;
                        }
                        else
                        {
-                               /* demux is in use, see if we can share it */
+                               // demux is in use, see if it can be shared
                                if (fesource >= 0 && i->m_demux->getSource() == fesource)
                                {
                                        i->m_demux->getCAAdapterID(a);
@@ -916,7 +911,7 @@ RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBA
                }
                else
                {
-                       if(i == m_demux.begin())
+                       if (i == m_demux.begin())
                                break;
                        --i;
                }
@@ -1332,7 +1327,7 @@ class eDVBChannelFilePush: public eFilePushThread
 {
 public:
        eDVBChannelFilePush(int packetsize = 188):
-               eFilePushThread(IOPRIO_CLASS_BE, 0, packetsize, packetsize * 512),
+               eFilePushThread(packetsize, packetsize * 512),
                m_iframe_search(0),
                m_iframe_state(0),
                m_pid(0),
index fdb140c..f9f5242 100644 (file)
@@ -530,6 +530,7 @@ int eDVBFrontend::openFrontend()
                        if (ioctl(m_fd, FE_GET_PROPERTY, &cmdseq) >= 0)
                        {
                                m_dvbversion = p.u.data;
+                               eDebug("[eDVBFrontend] frontend %d has DVB API %02x ", m_dvbid, m_dvbversion);
                        }
 #endif
                }