fixes bug #380
[enigma2.git] / lib / python / Screens / ServiceStopScreen.py
index 3b3dda8826887cd940a9f0355e9a46420eca69e0..628a93a5a0f819e7289751372afd07c8a6c9a334 100644 (file)
@@ -6,13 +6,26 @@ class ServiceStopScreen:
                        self.session
                except:
                        print "[ServiceStopScreen] ERROR: no self.session set"
-                       
+
                self.oldref = None
                self.onClose.append(self.__onClose)
                
+       def pipAvailable(self):
+               # pip isn't available in every state of e2
+               try:
+                       self.session.pipshown
+                       pipavailable = True
+               except:
+                       pipavailable = False
+               return pipavailable
+               
        def stopService(self):          
                self.oldref = self.session.nav.getCurrentlyPlayingServiceReference()
                self.session.nav.stopService()
+               if self.pipAvailable():
+                       if self.session.pipshown: # try to disable pip
+                               self.session.pipshown = False
+                               del self.session.pip
                
        def __onClose(self):
                self.session.nav.playService(self.oldref)