From 2341b90d5b6144df30eba997d88b8918ea61830a Mon Sep 17 00:00:00 2001 From: kos Date: Fri, 7 Sep 2012 06:59:29 +0900 Subject: [PATCH] [hbbtv] fix stream player. --- lib/python/Plugins/Extensions/HbbTV/plugin.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/python/Plugins/Extensions/HbbTV/plugin.py b/lib/python/Plugins/Extensions/HbbTV/plugin.py index 97a84dd..c44887c 100644 --- a/lib/python/Plugins/Extensions/HbbTV/plugin.py +++ b/lib/python/Plugins/Extensions/HbbTV/plugin.py @@ -575,6 +575,7 @@ class HandlerHbbTV(Handler): return (0, "OK") from libshm import SimpleSharedMemory +_g_ssm_ = None class HbbTVWindow(Screen, InfoBarNotifications): skin = """ @@ -612,7 +613,8 @@ class HbbTVWindow(Screen, InfoBarNotifications): self._currentServicePositionTimer.callback.append(self._cb_currentServicePosition) self._vodLength = 0 - self._ssm = SimpleSharedMemory() + global _g_ssm_ + self._ssm = _g_ssm_ self._vod_length = 0 def getVodPlayTime(self): @@ -644,7 +646,6 @@ class HbbTVWindow(Screen, InfoBarNotifications): def _serviceStarted(self): try: - self._ssm.doConnect() self._ssm.setStatus(0, 0, 0) self._currentServicePositionTimer.start(1000) except Exception, ErrMsg: @@ -652,16 +653,6 @@ class HbbTVWindow(Screen, InfoBarNotifications): def _serviceEOF(self): self._currentServicePositionTimer.stop() - if self._vod_length == -1: - self._vod_length = 0 - try: - self._ssm.setStatus(self._vod_length, self._vod_length, 2) - time.sleep(1) - self._ssm.doClose() - except Exception, ErrMsg: - print ErrMsg - command_util = getCommandUtil() - command_util.sendCommand('OP_VOD_STOPED', None) def _layoutFinished(self): command_util = getCommandUtil() @@ -734,6 +725,11 @@ class HbbTVHelper(Screen): __gval__.command_util = BrowserCommandUtil() + global _g_ssm_ + if _g_ssm_ is None: + _g_ssm_ = SimpleSharedMemory() + _g_ssm_.doConnect() + def _cb_registrate_infobar(self): if InfoBar.instance: self._timer_infobar.stop() -- 2.7.4