aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2009-04-19 23:33:44 +0200
committerFelix Domke <tmbinc@elitedvb.net>2009-04-19 23:33:44 +0200
commite8f443313e47e0653d61d23c90352572194e5608 (patch)
tree7188d3ea5a8c91066fe1dfd5f7241eeb3e3c5226 /lib
parent2d7f4e102ee3231bdb600b0ac7e2d8f898034b78 (diff)
parent0d076f400e8740e55289427c0f19c8055c74bbc5 (diff)
downloadenigma2-e8f443313e47e0653d61d23c90352572194e5608.tar.gz
enigma2-e8f443313e47e0653d61d23c90352572194e5608.zip
Merge branch 'master' of /home/tmbinc/enigma2-git
Diffstat (limited to 'lib')
-rw-r--r--lib/base/encoding.cpp19
-rw-r--r--lib/base/estring.cpp8
-rw-r--r--lib/components/file_eraser.cpp2
-rw-r--r--lib/dvb/decoder.cpp12
-rw-r--r--lib/dvb/frontend.cpp6
-rw-r--r--lib/dvb/sec.cpp26
-rw-r--r--lib/python/Plugins/Extensions/DVDPlayer/plugin.py4
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/plugin.py4
-rw-r--r--lib/python/Plugins/Extensions/MediaPlayer/settings.py2
-rw-r--r--lib/python/Screens/PluginBrowser.py22
-rwxr-xr-xlib/python/Screens/VirtualKeyBoard.py16
-rw-r--r--lib/service/servicedvb.cpp13
12 files changed, 87 insertions, 47 deletions
diff --git a/lib/base/encoding.cpp b/lib/base/encoding.cpp
index 45fea102..6a997cf1 100644
--- a/lib/base/encoding.cpp
+++ b/lib/base/encoding.cpp
@@ -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);
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp
index c5076a80..85bbcc69 100644
--- a/lib/base/estring.cpp
+++ b/lib/base/estring.cpp
@@ -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)
diff --git a/lib/components/file_eraser.cpp b/lib/components/file_eraser.cpp
index 031c30dd..9f92fa44 100644
--- a/lib/components/file_eraser.cpp
+++ b/lib/components/file_eraser.cpp
@@ -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
diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp
index ebe3ce24..eb5258d3 100644
--- a/lib/dvb/decoder.cpp
+++ b/lib/dvb/decoder.cpp
@@ -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();
}
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp
index f2fc12b3..a2ccf3b0 100644
--- a/lib/dvb/frontend.cpp
+++ b/lib/dvb/frontend.cpp
@@ -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();
diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp
index a9426ff7..25567ce8 100644
--- a/lib/dvb/sec.cpp
+++ b/lib/dvb/sec.cpp
@@ -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;
}
diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py
index ebcf4f81..e77b8940 100644
--- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py
@@ -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
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
index b0aa6274..0f46c996 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py
@@ -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()
diff --git a/lib/python/Plugins/Extensions/MediaPlayer/settings.py b/lib/python/Plugins/Extensions/MediaPlayer/settings.py
index 416ab2ee..8a032d16 100644
--- a/lib/python/Plugins/Extensions/MediaPlayer/settings.py
+++ b/lib/python/Plugins/Extensions/MediaPlayer/settings.py
@@ -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())
diff --git a/lib/python/Screens/PluginBrowser.py b/lib/python/Screens/PluginBrowser.py
index cd17e2e0..5ba7043d 100644
--- a/lib/python/Screens/PluginBrowser.py
+++ b/lib/python/Screens/PluginBrowser.py
@@ -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]):
diff --git a/lib/python/Screens/VirtualKeyBoard.py b/lib/python/Screens/VirtualKeyBoard.py
index 9b676a5f..bde6f75d 100755
--- a/lib/python/Screens/VirtualKeyBoard.py
+++ b/lib/python/Screens/VirtualKeyBoard.py
@@ -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()
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp
index 44a22ea9..0e6229c5 100644
--- a/lib/service/servicedvb.cpp
+++ b/lib/service/servicedvb.cpp
@@ -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();