Merge commit 'origin/bug_503_softwaremanager_catch_feederror'
authoracid-burn <acid-burn@opendreambox.org>
Wed, 14 Apr 2010 08:25:47 +0000 (10:25 +0200)
committeracid-burn <acid-burn@opendreambox.org>
Wed, 14 Apr 2010 08:25:47 +0000 (10:25 +0200)
data/menu.xml
data/skin.xml
lib/dvb/dvb.cpp
lib/dvb/scan.cpp
lib/dvb/scan.h
lib/gui/elistboxcontent.cpp
lib/python/Screens/ChannelSelection.py
po/ar.po
po/ca.po
po/cs.po
po/lt.po

index fbc529573a55143d65bf661f7e416bf0673800af..b437fbc7d7646bcfb4f3e48b2f712c13f70027d9 100755 (executable)
                        <item weight="10" level="1" text="Common Interface" entryID="ci_setup" requires="CommonInterface"><screen module="Ci" screen="CiSelection" /></item>
                        <item weight="15" level="0" text="Parental control" entryID="parental_setup"><screen module="ParentalControlSetup" screen="ParentalControlSetup" /></item>
                        <!--item level="0" text="Startwizard" entryID="startwizzard"><screen module="StartWizard" screen="StartWizard" /></item-->
-                       <item weight="20" level="0" text="Default settings" entryID="default_wizard">
-                               <code>
-from Screens.DefaultWizard import DefaultWizard
-self.session.open(DefaultWizard, silent = False)
-</code>
-                       </item>
                        <item weight="25" level="0" text="Factory reset" entryID="factory_reset">
                                <code>
 from Screens.FactoryReset import FactoryReset
index d5fe01e63972555a7ef60bd60713b941c04f4576..32adb2bea4fa1c500a8907c819900302d82b658d 100755 (executable)
                </widget>
                <!-- Remaining time -->
                <widget source="session.CurrentService" render="Label" position="576,129" size="100,20" font="Regular;18" halign="center" valign="center" backgroundColor="#06224f" shadowColor="#1d354c" shadowOffset="-1,-1" transparent="1">
-                       <convert type="ServicePosition">Remaining</convert>
+                       <convert type="ServicePosition">Remaining,Negate</convert>
                </widget>
        </screen>
 </skin>
index 6eaadb04db8de3f737c906c7c12bd2930c5aac6d..17712dde154bb39d5beed4096db20dc79474fa8e 100644 (file)
@@ -1324,16 +1324,6 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
                return;
        }
 
-       m_cue->m_lock.RdLock();
-       if (!m_cue->m_decoding_demux)
-       {
-               start = current_offset;
-               size = max;
-               eDebug("getNextSourceSpan, no decoding demux. forcing normal play");
-               m_cue->m_lock.Unlock();
-               return;
-       }
-
        if (m_skipmode_n)
        {
                eDebug("skipmode %d:%d (x%d)", m_skipmode_m, m_skipmode_n, m_skipmode_frames);
@@ -1341,7 +1331,6 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
        }
 
        eDebug("getNextSourceSpan, current offset is %08llx, m_skipmode_m = %d!", current_offset, m_skipmode_m);
-       
        int frame_skip_success = 0;
 
        if (m_skipmode_m)
@@ -1386,6 +1375,8 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
                }
        }
 
+       m_cue->m_lock.RdLock();
+
        while (!m_cue->m_seek_requests.empty())
        {
                std::pair<int, pts_t> seek = m_cue->m_seek_requests.front();
@@ -1410,6 +1401,13 @@ void eDVBChannel::getNextSourceSpan(off_t current_offset, size_t bytes_read, off
                                eDebug("decoder getPTS failed, can't seek relative");
                                continue;
                        }
+                       if (!m_cue->m_decoding_demux)
+                       {
+                               eDebug("getNextSourceSpan, no decoding demux. couldn't seek to %llx... ignore request!", pts);
+                               start = current_offset;
+                               size = max;
+                               continue;
+                       }
                        if (getCurrentPosition(m_cue->m_decoding_demux, now, 1))
                        {
                                eDebug("seekTo: getCurrentPosition failed!");
index fd29617a3054aa249983b64b12a92ac9428831f7..b37aa7141d106ddc38c74f4b7c137a222eb67f8b 100644 (file)
@@ -12,6 +12,7 @@
 #include <lib/dvb/frontend.h>
 #include <lib/base/eerror.h>
 #include <lib/base/estring.h>
+#include <lib/python/python.h>
 #include <errno.h>
 
 #define SCAN_eDebug(x...) do { if (m_scan_debug) eDebug(x); } while(0)
@@ -23,37 +24,118 @@ eDVBScan::eDVBScan(iDVBChannel *channel, bool usePAT, bool debug)
        :m_channel(channel), m_channel_state(iDVBChannel::state_idle)
        ,m_ready(0), m_ready_all(usePAT ? (readySDT|readyPAT) : readySDT)
        ,m_pmt_running(false), m_abort_current_pmt(false), m_flags(0)
-       ,m_usePAT(usePAT), m_scan_debug(debug)
+       ,m_usePAT(usePAT), m_scan_debug(debug), m_show_add_tsid_onid_check_failed_msg(true)
 {
        if (m_channel->getDemux(m_demux))
                SCAN_eDebug("scan: failed to allocate demux!");
        m_channel->connectStateChange(slot(*this, &eDVBScan::stateChange), m_stateChanged_connection);
+       FILE *f = fopen("/etc/enigma2/scan_tp_valid_check.py", "r");
+       if (f)
+       {
+               char code[16384];
+               size_t rd = fread(code, 1, 16383, f);
+               if (rd)
+               {
+                       code[rd]=0;
+                       m_additional_tsid_onid_check_func = Py_CompileString(code, "/etc/enigma2/scan_tp_valid_check.py", Py_file_input);
+               }
+               fclose(f);
+       }
 }
 
 eDVBScan::~eDVBScan()
 {
+       if (m_additional_tsid_onid_check_func)
+               Py_DECREF(m_additional_tsid_onid_check_func);
 }
 
 int eDVBScan::isValidONIDTSID(int orbital_position, eOriginalNetworkID onid, eTransportStreamID tsid)
 {
+       int ret;
        switch (onid.get())
        {
        case 0:
        case 0x1111:
-               return 0;
+               ret=0;
+               break;
        case 0x13E:  // workaround for 11258H and 11470V on hotbird with same ONID/TSID (0x13E/0x578)
-               return orbital_position != 130 || tsid != 0x578;
+               ret = orbital_position != 130 || tsid != 0x578;
+               break;
        case 1:
-               return orbital_position == 192;
+               ret = orbital_position == 192;
+               break;
        case 0x00B1:
-               return tsid != 0x00B0;
+               ret = tsid != 0x00B0;
+               break;
        case 0x00eb:
-               return tsid != 0x4321;
+               ret = tsid != 0x4321;
+               break;
        case 0x0002:
-               return abs(orbital_position-282) < 6;
+               ret = abs(orbital_position-282) < 6 && tsid != 2019;
+               // 12070H and 10936V have same tsid/onid.. but even the same services are provided
+               break;
+       case 0x2000:
+               ret = tsid != 0x1000;
+               break;
+       case 0x5E: // Sirius 4.8E 12322V and 12226H
+               ret = abs(orbital_position-48) < 3 && tsid != 1;
+               break;
+       case 10100: // Eutelsat W7 36.0E 11644V and 11652V
+               ret = orbital_position != 360 || tsid != 10187;
+               break;
+       case 42: // Tuerksat 42.0E
+               ret = orbital_position != 420 || (
+                   tsid != 8 && // 11830V 12729V
+                   tsid != 5 && // 12679V 12685H
+                   tsid != 2 && // 11096V 12015H
+                   tsid != 55); // 11996V 11716V
+               break;
+       case 100: // Intelsat 10 68.5E 3808V 3796V 4012V, Amos 4.0W 10723V 11571H
+               ret = (orbital_position != 685 && orbital_position != 3560) || tsid != 1;
+               break;
+       case 70: // Thor 0.8W 11862H 12341V
+               ret = abs(orbital_position-3592) < 3 && tsid != 46;
+               break;
+       case 32: // NSS 806 (40.5W) 4059R, 3774L
+               ret = orbital_position != 3195 || tsid != 21;
+               break;
        default:
-               return onid.get() < 0xFF00;
+               ret = onid.get() < 0xFF00;
+               break;
+       }
+       if (ret && m_additional_tsid_onid_check_func)
+       {
+               bool failed = true;
+               ePyObject dict = PyDict_New();
+               extern void PutToDict(ePyObject &, const char *, long);
+               PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins());
+               PutToDict(dict, "orbpos", orbital_position);
+               PutToDict(dict, "tsid", tsid.get());
+               PutToDict(dict, "onid", onid.get());
+               ePyObject r = PyEval_EvalCode((PyCodeObject*)(PyObject*)m_additional_tsid_onid_check_func, dict, dict);
+               if (r)
+               {
+                       ePyObject o = PyDict_GetItemString(dict, "ret");
+                       if (o)
+                       {
+                               if (PyInt_Check(o))
+                               {
+                                       ret = PyInt_AsLong(o);
+                                       failed = false;
+                               }
+                       }
+                       Py_DECREF(r);
+               }
+               if (failed && m_show_add_tsid_onid_check_failed_msg)
+               {
+                       eDebug("execing /etc/enigma2/scan_tp_valid_check failed!\n"
+                               "usable global variables in scan_tp_valid_check.py are 'orbpos', 'tsid', 'onid'\n"
+                               "the return value must be stored in a global var named 'ret'");
+                       m_show_add_tsid_onid_check_failed_msg=false;
+               }
+               Py_DECREF(dict);
        }
+       return ret;
 }
 
 eDVBNamespace eDVBScan::buildNamespace(eOriginalNetworkID onid, eTransportStreamID tsid, unsigned long hash)
index 2f3ac34a1ff65e3491c4bb98405088d81f054ae9..8f64abe506df5e8f14f0abb25dd0b8cc41639d29 100644 (file)
@@ -92,6 +92,8 @@ class eDVBScan: public Object, public iObject
        int m_flags;
        bool m_usePAT;
        bool m_scan_debug;
+       ePyObject m_additional_tsid_onid_check_func;
+       bool m_show_add_tsid_onid_check_failed_msg;
 public:
        eDVBScan(iDVBChannel *channel, bool usePAT=true, bool debug=true );
        ~eDVBScan();
index 4b4b58c1bc2c458d7e6d08dfd7ce06cf32b313ab..a65df2e2360484c98fd3aa639f8cf4526462945d 100644 (file)
@@ -49,7 +49,8 @@ int iListboxContent::currentCursorSelectable()
 
 DEFINE_REF(eListboxPythonStringContent);
 
-eListboxPythonStringContent::eListboxPythonStringContent(): m_itemheight(25), m_cursor(0)
+eListboxPythonStringContent::eListboxPythonStringContent()
+       :m_cursor(0), m_itemheight(25)
 {
 }
 
@@ -81,7 +82,7 @@ int eListboxPythonStringContent::cursorMove(int count)
 
 int eListboxPythonStringContent::cursorValid()
 {
-       return ((unsigned int)m_cursor) < size();
+       return m_cursor < size();
 }
 
 int eListboxPythonStringContent::cursorSet(int n)
index 4ca6fa39996dd16b4e825da315a7e8a02d6dd6b1..0895c9c201398eac4b98723f21d3f7bb2b08d088 100644 (file)
@@ -449,7 +449,7 @@ class ChannelSelectionEdit:
                                if mutableAlternatives:
                                        mutableAlternatives.setListName(name)
                                        if mutableAlternatives.addService(cur_service.ref):
-                                               print "add", cur_service.toString(), "to new alternatives failed"
+                                               print "add", cur_service.ref.toString(), "to new alternatives failed"
                                        mutableAlternatives.flushChanges()
                                        self.servicelist.addService(new_ref.ref, True)
                                        self.servicelist.removeCurrent()
index abf2dfb58346929e64d3d5729b6e24137902c2f5..678a9fd1a962386fc85ec4b5eab351f43d3f461f 100755 (executable)
--- a/po/ar.po
+++ b/po/ar.po
@@ -4471,12 +4471,6 @@ msgid ""
 "cleaned up.\n"
 "You can use this wizard to remove some extensions.\n"
 msgstr ""
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
 
 msgid ""
 "Welcome.\n"
index f031cc154ad331c95c2df00018be90c01af335cf..d5e036a456ba4932077c5436f35aaf7ce64d3a8d 100755 (executable)
--- a/po/ca.po
+++ b/po/ca.po
@@ -4567,12 +4567,6 @@ msgid ""
 "cleaned up.\n"
 "You can use this wizard to remove some extensions.\n"
 msgstr ""
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
 
 msgid ""
 "Welcome.\n"
index 14d56c382d680bb6cf282eee5c200ece8be49f60..508f3d178c34922bebbdfd873da0fbedd5105543 100755 (executable)
--- a/po/cs.po
+++ b/po/cs.po
@@ -4606,12 +4606,6 @@ msgid ""
 "cleaned up.\n"
 "You can use this wizard to remove some extensions.\n"
 msgstr ""
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
 
 msgid ""
 "Welcome.\n"
index 6e984b2a04430592e4b977df1420e2b1671a5562..4aef254a03d3935be044a177ee04e7582ec5b160 100755 (executable)
--- a/po/lt.po
+++ b/po/lt.po
@@ -4594,12 +4594,6 @@ msgid ""
 "To ensure stable operation of your Dreambox, the internal memory should be cleaned up.\n"
 "You can use this wizard to remove some extensions.\n"
 msgstr ""
-"PO-Peržiūrėjimo-Data: 2010-02-26 20:49\n"
-"Paskutinis-Vertėjas: AUDRONIS GRINCEVIČIUS <audrgrin@takas.lt>\n"
-"Kalbos-Komanda: LITHUANIAN <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
 
 msgid ""
 "Welcome.\n"