fix return codes in streaming
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 17 Feb 2008 23:16:49 +0000 (23:16 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 17 Feb 2008 23:16:49 +0000 (23:16 +0000)
lib/python/Components/Converter/Streaming.py
lib/service/iservice.h
lib/service/servicedvbrecord.cpp

index ece174908084c0ad49fa98786cc1a6f0a65e687e..f12ebd99243e8fbc3d49f321769be7250c471e53 100644 (file)
@@ -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)
 
index bfdca1ba46c6337a3354ce05aeba28f94e51779b..f367f6ad0af16efb27792abcf128e5c1f64cfdae 100644 (file)
@@ -782,7 +782,9 @@ public:
                errNoDemuxAvailable=-2,
                errNoTsRecorderAvailable=-3,
                errDiskFull=-4,
-               errTuneFailed=-255
+               errTuneFailed=-255,
+               errMisconfiguration = -256,
+               errNoResources = -257,
        };
 };
 
index b34dad10e0ba397a3c7f0446c28b1a8f5021a6fe..86461d051d2e64cb3c95d1781e1a96038e872daa 100644 (file)
@@ -45,6 +45,14 @@ void eDVBServiceRecord::serviceEvent(int event)
                m_event((iRecordableService*)this, evNewProgramInfo);
                break;
        }
+       case eDVBServicePMTHandler::eventMisconfiguration:
+               m_error = errMisconfiguration;
+               m_event((iRecordableService*)this, evTuneFailed);
+               break;
+       case eDVBServicePMTHandler::eventNoResources:
+               m_error = errNoResources;
+               m_event((iRecordableService*)this, evTuneFailed);
+               break;
        }
 }