Merge branch 'master' of /home/tmbinc/enigma2-git
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 19 Apr 2009 21:33:44 +0000 (23:33 +0200)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 19 Apr 2009 21:33:44 +0000 (23:33 +0200)
13 files changed:
data/encoding.conf
lib/base/encoding.cpp
lib/base/estring.cpp
lib/components/file_eraser.cpp
lib/dvb/decoder.cpp
lib/dvb/frontend.cpp
lib/dvb/sec.cpp
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
lib/python/Plugins/Extensions/MediaPlayer/settings.py
lib/python/Screens/PluginBrowser.py
lib/python/Screens/VirtualKeyBoard.py
lib/service/servicedvb.cpp

index d9d115e0cd95ea016edbb8ddb873a7c67a6b4cd7..1ec5f35071f19c3497307cc86f5f67d607fe7cd8 100644 (file)
@@ -17,18 +17,20 @@ bul ISO8859-5
 0xc89 0x3
 0xc8f 0x3
 0xbc7 0x3
-0x436 0x1 #ASTRA 19.2° MTV Euro - MTV Networks
-0x42a 0x1 #ASTRA 19.2° VH1 Classic - MTV Networks
-11000 318 #Hotbird 13.0° Cyfra+
-11900 318
-12200 318
+400 318 #Hotbird 13.0° Cyfra+
 1500 318
-400 318
-13000 318
-12800 318
+11000 318
 11400 318
-1000 318
-7400 318
+11900 318
+7400 113 #Hotbird 13.0° Cyfrowy Polsat
+7800 113
+7900 113
+13200 113
+1000 318 #Grupa ITI
+1600 318 #Filmbox Polska and other
+12200 318 #Disney Channel Polska and other
+12800 318 #Viacom ... MTV / VH1 Polska
+13000 318 #BBC Polska and other
 #Fallback encoding table for following transponders
 #TSID ONID ISO8859-X
 #0x447 0x1 ISO8859-9
@@ -40,3 +42,4 @@ bul ISO8859-5
 50800 126 ISO8859-9 # Digiturk 7°E 11.678 H 30.000 3/4
 50900 126 ISO8859-9 # Skyturk  7°E 11.513 H 27.500 3/4
 51000 126 ISO8859-9 # Digiturk 7°E 11.617 V 30.000 3/4
+12800 318 ISO6397 #Viacom ... MTV / VH1 Polska
index 45fea10249c1c4206e1b5375df5ba5b61cc4ef01..6a997cf13d8ccc95b871c4ce072a6c132d530e24 100644 (file)
@@ -28,7 +28,10 @@ eDVBTextEncodingHandler::eDVBTextEncodingHandler()
                        if ( line[0] == '#' )
                                continue;
                        int tsid, onid, encoding;
-                       if ( sscanf( line, "%s ISO8859-%d", countrycode, &encoding ) == 2 )
+                       if ( (sscanf( line, "0x%x 0x%x ISO8859-%d", &tsid, &onid, &encoding ) == 3 )
+                                       ||(sscanf( line, "%d %d ISO8859-%d", &tsid, &onid, &encoding ) == 3 ) )
+                               m_TransponderDefaultMapping[(tsid<<16)|onid]=encoding;
+                       else if ( sscanf( line, "%s ISO8859-%d", countrycode, &encoding ) == 2 )
                        {
                                m_CountryCodeDefaultMapping[countrycode]=encoding;
                                countrycode[0]=toupper(countrycode[0]);
@@ -36,9 +39,17 @@ eDVBTextEncodingHandler::eDVBTextEncodingHandler()
                                countrycode[2]=toupper(countrycode[2]);
                                m_CountryCodeDefaultMapping[countrycode]=encoding;
                        }
-                       else if ( (sscanf( line, "0x%x 0x%x ISO8859-%d", &tsid, &onid, &encoding ) == 3 )
-                                       ||(sscanf( line, "%d %d ISO8859-%d", &tsid, &onid, &encoding ) == 3 ) )
-                               m_TransponderDefaultMapping[(tsid<<16)|onid]=encoding;
+                       else if ( (sscanf( line, "0x%x 0x%x ISO%d", &tsid, &onid, &encoding ) == 3 && encoding == 6397 )
+                                       ||(sscanf( line, "%d %d ISO%d", &tsid, &onid, &encoding ) == 3 && encoding == 6397 ) )
+                               m_TransponderDefaultMapping[(tsid<<16)|onid]=64;
+                       else if ( sscanf( line, "%s ISO%d", countrycode, &encoding ) == 2 && encoding == 6397 )
+                       {
+                               m_CountryCodeDefaultMapping[countrycode]=64;
+                               countrycode[0]=toupper(countrycode[0]);
+                               countrycode[1]=toupper(countrycode[1]);
+                               countrycode[2]=toupper(countrycode[2]);
+                               m_CountryCodeDefaultMapping[countrycode]=64;
+                       }
                        else if ( (sscanf( line, "0x%x 0x%x", &tsid, &onid ) == 2 )
                                        ||(sscanf( line, "%d %d", &tsid, &onid ) == 2 ) )
                                m_TransponderUseTwoCharMapping.insert((tsid<<16)|onid);
index c5076a807eec16b562fb11cf70d10c7b30d6fb65..85bbcc6986f4140c5b7db1f31514b38b17cfac8f 100644 (file)
@@ -383,9 +383,9 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
                        break;
                case 0x10:
                {
-//                     eDebug("(0x10)text encoded in ISO-8859-%d",n);
                        int n=(data[++i]<<8);
                        n |= (data[++i]);
+//                     eDebug("(0x10)text encoded in ISO-8859-%d",n);
                        ++i;
                        switch(n)
                        {
@@ -427,8 +427,10 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts
        bool useTwoCharMapping =
                tsidonid && encodingHandler.getTransponderUseTwoCharMapping(tsidonid);
 
-       if (useTwoCharMapping)
-               table = 64;
+       if (useTwoCharMapping) {
+               if (table == 5)
+                       table = 64;
+       }
 
        unsigned char res[2048];
        while (i < len)
index 031c30dd6dc76b56088618617825d12078ea10d5..9f92fa443012c5dee57090f82c5433ca5e9e29d8 100644 (file)
@@ -52,7 +52,7 @@ void eBackgroundFileEraser::erase(const char *filename)
        if (filename)
        {
                char buf[255];
-               snprintf(buf, 255, "%s.$$$", filename);
+               snprintf(buf, 255, "%s.del", filename);
                if (rename(filename, buf)<0)
                        ;/*perror("rename file failed !!!");*/
                else
index ebe3ce24fe90d75f89c42eb60a5458b59e232a31..eb5258d34825191c593d4e23116738362baca955 100644 (file)
@@ -1170,9 +1170,15 @@ RESULT eTSMPEGDecoder::set()
 RESULT eTSMPEGDecoder::play()
 {
        if (m_state == statePlay)
-               return 0;
-       m_state = statePlay;
-       m_changed |= changeState;
+       {
+               if (!m_changed)
+                       return 0;
+       }
+       else
+       {
+               m_state = statePlay;
+               m_changed |= changeState;
+       }
        return setState();
 }
 
index f2fc12b318889a51c1657a9a9f0b537183e8675e..a2ccf3b0e8e82f7e767d5dc0caac24a1e50a9dc7 100644 (file)
@@ -448,7 +448,7 @@ int eDVBFrontend::PriorityOrder=0;
 eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate)
        :m_simulate(simulate), m_enabled(false), m_type(-1), m_dvbid(fe), m_slotid(fe)
        ,m_fd(-1), m_need_rotor_workaround(false), m_can_handle_dvbs2(false)
-       , m_timeout(0), m_tuneTimer(0)
+       ,m_state(stateClosed), m_timeout(0), m_tuneTimer(0)
 #if HAVE_DVB_API_VERSION < 3
        ,m_secfd(-1)
 #endif
@@ -477,7 +477,7 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate)
 
 int eDVBFrontend::openFrontend()
 {
-       if (m_sn)
+       if (m_state != stateClosed)
                return -1;  // already opened
 
        m_state=stateIdle;
@@ -1349,7 +1349,7 @@ void eDVBFrontend::tuneLoop()  // called by m_tuneTimer
                                state = sec_fe->m_state;
                        }
                        // sec_fe is closed... we must reopen it here..
-                       if (state == eDVBFrontend::stateClosed)
+                       if (state == stateClosed)
                        {
                                regFE = prev;
                                prev->inc_use();
index a9426ff7451084d75ecf810a99bef9211411f7d0..25567ce80a78c3e57278eabe607824c1568da1f9 100644 (file)
@@ -61,14 +61,14 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
        bool direct_connected = m_not_linked_slot_mask & slot_id;
        int score=0, satcount=0;
        long linked_prev_ptr=-1, linked_next_ptr=-1, linked_csw=-1, linked_ucsw=-1, linked_toneburst=-1,
-               satpos_depends_ptr=-1, rotor_pos=-1;
+               fe_satpos_depends_ptr=-1, fe_rotor_pos=-1;
        bool linked_in_use = false;
 
        eSecDebugNoSimulate("direct_connected %d", !!direct_connected);
 
        fe->getData(eDVBFrontend::LINKED_PREV_PTR, linked_prev_ptr);
        fe->getData(eDVBFrontend::LINKED_NEXT_PTR, linked_next_ptr);
-       fe->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, satpos_depends_ptr);
+       fe->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, fe_satpos_depends_ptr);
 
        // first we search the linkage base frontend and check if any tuner in prev direction is used
        while (linked_prev_ptr != -1)
@@ -80,7 +80,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                linked_fe->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, (long&)linked_prev_ptr);
        }
 
-       fe->getData(eDVBFrontend::ROTOR_POS, rotor_pos);
+       fe->getData(eDVBFrontend::ROTOR_POS, fe_rotor_pos);
 
        // now check also the linked tuners  is in use
        while (!linked_in_use && linked_next_ptr != -1)
@@ -123,10 +123,11 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                        {
                                bool diseqc=false;
                                long band=0,
-                                       satpos_depends_ptr=-1,
+                                       satpos_depends_ptr=fe_satpos_depends_ptr,
                                        csw = di_param.m_committed_cmd,
                                        ucsw = di_param.m_uncommitted_cmd,
-                                       toneburst = di_param.m_toneburst_param;
+                                       toneburst = di_param.m_toneburst_param,
+                                       rotor_pos = fe_rotor_pos;
 
                                eSecDebugNoSimulate("sat %d found", sat.orbital_position);
 
@@ -169,15 +170,13 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                        eSecDebugNoSimulate("ret2 %d", ret);
                                        if (ret) // special case when this tuner is linked to a satpos dependent tuner
                                        {
-                                               long satpos_depends_ptr=-1;
                                                fe->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, satpos_depends_ptr);
                                                if (satpos_depends_ptr != -1)
                                                {
                                                        eDVBRegisteredFrontend *satpos_depends_to_fe = (eDVBRegisteredFrontend*) satpos_depends_ptr;
-                                                       long satpos_depends_rotor_pos;
-                                                       satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, satpos_depends_rotor_pos);
-                                                       if (!rotor || satpos_depends_rotor_pos == -1 /* we dont know the rotor position yet */
-                                                               || satpos_depends_rotor_pos != sat.orbital_position ) // not the same orbital position?
+                                                       satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, rotor_pos);
+                                                       if (!rotor || rotor_pos == -1 /* we dont know the rotor position yet */
+                                                               || rotor_pos != sat.orbital_position ) // not the same orbital position?
                                                        {
                                                                ret = 0;
                                                        }
@@ -200,10 +199,9 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                        else // current fe is dependent of another tuner ... (so this fe can't turn the rotor!)
                                        {
                                                // get current orb pos of the tuner with rotor connection
-                                               long satpos_depends_rotor_pos;
-                                               satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, satpos_depends_rotor_pos);
-                                               if (!rotor || satpos_depends_rotor_pos == -1 /* we dont know the rotor position yet */
-                                                       || satpos_depends_rotor_pos != sat.orbital_position ) // not the same orbital position?
+                                               satpos_depends_to_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, rotor_pos);
+                                               if (!rotor || rotor_pos == -1 /* we dont know the rotor position yet */
+                                                       || rotor_pos != sat.orbital_position ) // not the same orbital position?
                                                {
                                                        ret = 0;
                                                }
index ebcf4f81a657189106cd89c66bd48773f51640b5..e77b894038e975e2a0e94da51975243fc9944796 100644 (file)
@@ -14,7 +14,6 @@ from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
 from Components.config import config
 from Tools.Directories import pathExists, fileExists
 from Components.Harddisk import harddiskmanager
-from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
 
 import servicedvd # load c++ part of dvd player plugin
 
@@ -346,6 +345,8 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                        })
 
                self.onClose.append(self.__onClose)
+
+               from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
                hotplugNotifier.append(self.hotplugCB)
                
                if dvd_device:
@@ -627,6 +628,7 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
        def __onClose(self):
                self.restore_infobar_seek_config()
                self.session.nav.playService(self.oldService)
+               from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
                hotplugNotifier.remove(self.hotplugCB)
 
        def playLastCB(self, answer): # overwrite infobar cuesheet function
index b0aa627495c4e90d95d9a9855e84e0a84f75c074..0f46c99610844ecb2658c1a89b73ea0397741047 100644 (file)
@@ -21,7 +21,6 @@ from Components.Harddisk import harddiskmanager
 from Components.config import config
 from Tools.Directories import fileExists, pathExists, resolveFilename, SCOPE_CONFIG, SCOPE_PLAYLIST, SCOPE_SKIN_IMAGE
 from settings import MediaPlayerSettings
-from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
 import random
 
 class MyPlayList(PlayList):
@@ -137,6 +136,8 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                self["repeat"] = MultiPixmap()
 
                self.seek_target = None
+
+               from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
                hotplugNotifier.append(self.hotplugCB)
 
                class MoviePlayerActionMap(NumberActionMap):
@@ -244,6 +245,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                if config.mediaplayer.saveDirOnExit.getValue():
                        config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
                        config.mediaplayer.defaultDir.save()
+               from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
                hotplugNotifier.remove(self.hotplugCB)
                del self["coverArt"].picload
                self.close()
index 416ab2ee3389d433a4b5f89a097edd9ab0352fb1..8a032d16f62587f08ffdf17c72475452e1e17831 100644 (file)
@@ -46,7 +46,7 @@ class DirectoryBrowser(Screen, HelpableScreen):
                        self.filelist.descent()
 
        def use(self):
-               if self.filelist.canDescent() and len(self["filelist"].getFilename()) > len(self["filelist"].getCurrentDirectory()):
+               if self.filelist.canDescent() and self["filelist"].getFilename() and len(self["filelist"].getFilename()) > len(self["filelist"].getCurrentDirectory()):
                        self.filelist.descent()
                self.close(self["filelist"].getCurrentDirectory())
 
index cd17e2e046f6260d297a24730942da33aebc7730..5ba7043d663aa87117705be07eb259d4b89644c2 100644 (file)
@@ -12,6 +12,7 @@ from Plugins.Plugin import PluginDescriptor
 from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
 from Tools.LoadPixmap import LoadPixmap
 
+from time import time
 
 class PluginBrowser(Screen):
        def __init__(self, session):
@@ -65,7 +66,8 @@ class PluginBrowser(Screen):
 class PluginDownloadBrowser(Screen):
        DOWNLOAD = 0
        REMOVE = 1
-       
+       lastDownloadDate = None
+
        def __init__(self, session, type):
                Screen.__init__(self, session)
                
@@ -130,14 +132,22 @@ class PluginDownloadBrowser(Screen):
                elif self.type == self.REMOVE:
                        self.setTitle(_("Remove plugins"))
 
+       def startIpkgListInstalled(self):
+               self.container.execute("ipkg list_installed enigma2-plugin-*")
+
        def startRun(self):
                self["list"].instance.hide()
                if self.type == self.DOWNLOAD:
-                       self.container.execute("ipkg update")
+                       if not PluginDownloadBrowser.lastDownloadDate or (time() - PluginDownloadBrowser.lastDownloadDate) > 3600:
+                               # Only update from internet once per hour
+                               self.container.execute("ipkg update")
+                               PluginDownloadBrowser.lastDownloadDate = time()
+                       else:
+                               self.startIpkgListInstalled()
                elif self.type == self.REMOVE:
                        self.run = 1
-                       self.container.execute("ipkg list_installed enigma2-plugin-*")
-               
+                       self.startIpkgListInstalled()
+
        def installFinished(self):
                plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
                self.container.appClosed.remove(self.runFinished)
@@ -149,7 +159,7 @@ class PluginDownloadBrowser(Screen):
                if self.run == 0:
                        self.run = 1
                        if self.type == self.DOWNLOAD:
-                               self.container.execute("ipkg list_installed enigma2-plugin-*")
+                               self.startIpkgListInstalled()
                elif self.run == 1 and self.type == self.DOWNLOAD:
                        self.run = 2
                        self.container.execute("ipkg list enigma2-plugin-*")
@@ -192,7 +202,7 @@ class PluginDownloadBrowser(Screen):
                
                self.plugins = {}
                for x in self.pluginlist:
-                       split = x[3].split('-')
+                       split = x[3].split('-', 1)
                        if len(split) < 2:
                                continue
                        if not self.plugins.has_key(split[0]):
index 9b676a5ff3eb5c780736c409aeae90cd60dfb750..bde6f75db712bb65163f889357fdf7c0b464900d 100755 (executable)
@@ -157,6 +157,8 @@ class VirtualKeyBoard(Screen):
                        }, -2)
                
                self.onLayoutFinish.append(self.buildVirtualKeyBoard)
+       
+               self.max_key=47+len(self.keys_list[4])
 
        def buildVirtualKeyBoard(self, selectedKey=0):
                list = []
@@ -251,7 +253,7 @@ class VirtualKeyBoard(Screen):
                elif self.selectedKey == 35:
                        self.selectedKey = 47
                elif self.selectedKey == 47:
-                       self.selectedKey = 59
+                       self.selectedKey = self.max_key
                
                self.showActiveKey()
 
@@ -266,7 +268,7 @@ class VirtualKeyBoard(Screen):
                        self.selectedKey = 24
                elif self.selectedKey == 48:
                        self.selectedKey = 36
-               elif self.selectedKey == 60:
+               elif self.selectedKey > self.max_key:
                        self.selectedKey = 48
                
                self.showActiveKey()
@@ -274,16 +276,20 @@ class VirtualKeyBoard(Screen):
        def up(self):
                self.selectedKey -= 12
                
-               if self.selectedKey < 0:
-                       self.selectedKey += 60
+               if (self.selectedKey < 0) and (self.selectedKey > (self.max_key-60)):
+                       self.selectedKey += 48
+               elif self.selectedKey < 0:
+                       self.selectedKey += 60  
                
                self.showActiveKey()
 
        def down(self):
                self.selectedKey += 12
                
-               if self.selectedKey > 59:
+               if (self.selectedKey > self.max_key) and (self.selectedKey > 59):
                        self.selectedKey -= 60
+               elif self.selectedKey > self.max_key:
+                       self.selectedKey -= 48
                
                self.showActiveKey()
 
index 44a22ea9265dd8249968d61b8f5e1987f03cf177..0e6229c5126d582e68faf72409b82d5ad2fe0d00 100644 (file)
@@ -1184,7 +1184,7 @@ RESULT eDVBServicePlay::setFastForward_internal(int ratio)
                return -1;
                
        if (ffratio == 0)
-               return 0; /* return m_decoder->play(); is done in caller*/
+               ; /* return m_decoder->play(); is done in caller*/
        else if (ffratio != 1)
                return m_decoder->setFastForward(ffratio);
        else
@@ -1602,7 +1602,7 @@ RESULT eDVBServicePlay::selectTrack(unsigned int i)
 {
        int ret = selectAudioStream(i);
 
-       if (m_decoder->play())
+       if (m_decoder->set())
                return -5;
 
        return ret;
@@ -1684,8 +1684,6 @@ int eDVBServicePlay::selectAudioStream(int i)
                eDebug("set audio pid failed");
                return -4;
        }
-       
-       m_decoder->set();
 
                /* if we are not in PVR mode, timeshift is not active and we are not in pip mode, check if we need to enable the rds reader */
        if (!(m_is_pvr || m_timeshift_active || !m_is_primary))
@@ -1718,11 +1716,16 @@ int eDVBServicePlay::selectAudioStream(int i)
                        m_dvb_service->setCacheEntry(eDVBService::cAPID, apid);
                        m_dvb_service->setCacheEntry(eDVBService::cAC3PID, -1);
                }
-               else
+               else if (apidtype == eDVBAudio::aAC3)
                {
                        m_dvb_service->setCacheEntry(eDVBService::cAPID, -1);
                        m_dvb_service->setCacheEntry(eDVBService::cAC3PID, apid);
                }
+               else
+               {
+                       m_dvb_service->setCacheEntry(eDVBService::cAPID, -1);
+                       m_dvb_service->setCacheEntry(eDVBService::cAC3PID, -1);
+               }
        }
 
        h.resetCachedProgram();