fix actual selection of subtitle stream
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 5 Jun 2006 21:39:01 +0000 (21:39 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 5 Jun 2006 21:39:01 +0000 (21:39 +0000)
lib/python/Screens/InfoBarGenerics.py
lib/service/servicedvb.cpp

index 948ecbf6e2c90b27128525151cc5e12e49f82bb8..caf5152bfb475e09bb9d0505f0fd1a7e91a537f7 100644 (file)
@@ -1034,8 +1034,9 @@ class InfoBarExtensions:
                        list.append((_("Swap services"), self.PIPSWAP))
                
                s = self.getCurrentServiceSubtitle()
+               l = s and s.getSubtitleList() or [ ]
                
-               for x in s.getSubtitleList():
+               for x in l:
                        list.append(("DEBUG: Enable Subtitles: " + x[0], self.ENABLE_SUBTITLE, x))
                
                self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list = list)
@@ -1638,7 +1639,7 @@ class InfoBarSubtitleSupport(object):
                subtitle = self.getCurrentServiceSubtitle()
                if enable and self.__selected_subtitle:
                        if subtitle and not self.__subtitles_enabled:
-                               subtitle.enableSubtitles(self.subtitle_window.instance, self.selected_subtitle)
+                               subtitle.enableSubtitles(self.subtitle_window.instance, self.selected_subtitle[1])
                                self.subtitle_window.show()
                                self.__subtitles_enabled = True
                else:
index 826c29aafec2a9a138f1dff71aa36a126aae84a6..f67ea96b65827f8c17b05bf3186945d3f7acff22 100644 (file)
@@ -1848,8 +1848,18 @@ RESULT eDVBServicePlay::enableSubtitles(eWidget *parent, PyObject *entry)
        if (m_subtitle_widget)
                disableSubtitles(parent);
        
+       if (!m_teletext_parser)
+               return -1;
+       
+       if (!PyInt_Check(entry))
+               return -1;
+       
        m_subtitle_widget = new eSubtitleWidget(parent);
        m_subtitle_widget->resize(parent->size()); /* full size */
+       
+       int page = PyInt_AsLong(entry);
+       
+       m_teletext_parser->setPage(page);
 
        return 0;
 }