fix audio selector when service doesn't support audio track selection
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 7 Aug 2006 18:48:42 +0000 (18:48 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 7 Aug 2006 18:48:42 +0000 (18:48 +0000)
lib/python/Screens/InfoBarGenerics.py

index 9562d0b..c2d6004 100644 (file)
@@ -1228,11 +1228,11 @@ class InfoBarAudioSelection:
                service = self.session.nav.getCurrentService()
                audio = service and service.audioTracks()
                self.audioTracks = audio
                service = self.session.nav.getCurrentService()
                audio = service and service.audioTracks()
                self.audioTracks = audio
-               n = audio and audio.getNumberOfTracks()
+               n = audio and audio.getNumberOfTracks() or 0
                keys = [ "red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n
                tlist = []
                print "tlist:", tlist
                keys = [ "red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n
                tlist = []
                print "tlist:", tlist
-               if n and n > 0:
+               if n > 0:
                        self.audioChannel = service.audioChannel()
 
                        for x in range(n):
                        self.audioChannel = service.audioChannel()
 
                        for x in range(n):