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 948ecbf..caf5152 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 826c29a..f67ea96 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;
 }