Skip to content

Commit

Permalink
[ServiceInfo.py] update
Browse files Browse the repository at this point in the history
  • Loading branch information
madie66 authored and koivo committed Jun 26, 2016
1 parent 0317d94 commit 31b8b4f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/python/Components/Converter/ServiceInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ def getServiceInfoString(self, info, what, convert = lambda x: "%d" % x):
return info.getInfoString(what)
return convert(v)

def getServiceInfoHexString(self, info, what, convert = lambda x: "%04x" % x):
v = info.getInfo(what)
if v == -1:
return "N/A"
if v == -2:
return info.getInfoString(what)
return convert(v)

@cached
def getBoolean(self):
service = self.source.service
Expand Down Expand Up @@ -112,7 +120,7 @@ def getBoolean(self):
while idx < n:
i = audio.getTrackInfo(idx)
description = i.getDescription()
if description in ("AC3", "AC-3", "AC3+", "DTS"):
if description in ("AC3", "AC-3", "DTS"):
if self.type == self.IS_MULTICHANNEL:
return True
elif self.type == self.AUDIO_STEREO:
Expand Down Expand Up @@ -205,7 +213,7 @@ def getText(self):
elif self.type == self.ONID:
return self.getServiceInfoString(info, iServiceInformation.sONID)
elif self.type == self.SID:
return self.getServiceInfoString(info, iServiceInformation.sSID)
return self.getServiceInfoHexString(info, iServiceInformation.sSID)
elif self.type == self.FRAMERATE:
return self.getServiceInfoString(info, iServiceInformation.sFrameRate, lambda x: "%d fps" % ((x+500)/1000))
elif self.type == self.TRANSFERBPS:
Expand Down Expand Up @@ -236,4 +244,4 @@ def getValue(self):

def changed(self, what):
if what[0] != self.CHANGED_SPECIFIC or what[1] in self.interesting_events:
Converter.changed(self, what)
Converter.changed(self, what)

0 comments on commit 31b8b4f

Please sign in to comment.