From: kos Date: Thu, 6 Sep 2012 21:59:29 +0000 (+0900) Subject: [hbbtv] fix stream player. X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=2341b90d5b6144df30eba997d88b8918ea61830a [hbbtv] fix stream player. --- 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()