servicem2ts: Skip when libpassthrough is not present
authorMike Looijmans <milo-software@users.sourceforge.net>
Fri, 4 Mar 2011 19:21:31 +0000 (20:21 +0100)
committerMike Looijmans <milo-software@users.sourceforge.net>
Fri, 4 Mar 2011 19:21:31 +0000 (20:21 +0100)
lib/service/servicem2ts.cpp

index e79907d..5ab5b86 100644 (file)
@@ -1,3 +1,5 @@
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <lib/base/init_num.h>
 #include <lib/base/init.h>
 #include <lib/dvb/metaparser.h>
@@ -311,6 +313,12 @@ off_t eM2TSFile::length()
 
 eServiceFactoryM2TS::eServiceFactoryM2TS()
 {
+       struct stat dummy;
+       if (stat("/usr/lib/libpassthrough.so", &dummy) != 0)
+       {
+               eDebug("eServiceFactoryM2TS aborted, no /usr/lib/libpassthrough.so");
+               return;
+       }
        ePtr<eServiceCenter> sc;
        eServiceCenter::getPrivInstance(sc);
        if (sc)