aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Converter
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2008-02-17 23:16:49 +0000
committerFelix Domke <tmbinc@elitedvb.net>2008-02-17 23:16:49 +0000
commit3d90ab1f54d07c4a25811b3819befacefd0a774d (patch)
tree4d702cbde458bd5a0485b9f56da4baf8fb746442 /lib/python/Components/Converter
parent89247308c18ca8b36b6973f780fd3ae6c0563dfc (diff)
downloadenigma2-3d90ab1f54d07c4a25811b3819befacefd0a774d.tar.gz
enigma2-3d90ab1f54d07c4a25811b3819befacefd0a774d.zip
fix return codes in streaming
Diffstat (limited to 'lib/python/Components/Converter')
-rw-r--r--lib/python/Components/Converter/Streaming.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/python/Components/Converter/Streaming.py b/lib/python/Components/Converter/Streaming.py
index ece17490..f12ebd99 100644
--- a/lib/python/Components/Converter/Streaming.py
+++ b/lib/python/Components/Converter/Streaming.py
@@ -1,6 +1,13 @@
from Converter import Converter
from Components.Element import cached
+# the protocol works as the following:
+
+# lines starting with '-' are fatal errors (no recovery possible),
+# lines starting with '=' are progress notices,
+# lines starting with '+' are PIDs to record:
+# "+d:[p:t[,p:t...]]" with d=demux nr, p: pid, t: type
+
class Streaming(Converter):
def __init__(self, type):
Converter.__init__(self, type)
@@ -9,21 +16,21 @@ class Streaming(Converter):
def getText(self):
service = self.source.service
if service is None:
- return "-NO SERVICE"
+ return "-NO SERVICE\n"
streaming = service.stream()
s = streaming and streaming.getStreamingData()
- if streaming is None:
+ if s is None:
err = service.getError()
- return "-1SERVICE ERROR:%d" % err
-
- r = streaming.getStreamingData()
- if r is None:
- return "-NO STREAM"
-
- demux = r["demux"]
- pids = ','.join(["%x:%s" % (x[0], x[1]) for x in r["pids"]])
+ from enigma import iRecordableService
+ if err:
+ return "-SERVICE ERROR:%d\n" % err
+ else:
+ return "=NO STREAM\n"
+
+ demux = s["demux"]
+ pids = ','.join(["%x:%s" % (x[0], x[1]) for x in s["pids"]])
return "+%d:%s\n" % (demux, pids)