[PATCH] Miscellaneous DVB fixes

Andrew de Quincey <[email protected]> Mon, 11 Aug 2003 11:25:50 +0100
Newsgroups gmane.comp.video.videolan.vls.devel
Message-ID <[email protected]>
This patch addresses the following issues with DVB support:

1) Compile failure with latest CVS

Extra parameter added to C_Broadcast

2) Adds support for latest libdvb releases

Is back-compatable with older releases

3) Fixes busy-loop on tuning failure

This is bad, but even worse if you happen to be running vls at FIFO 1 
priority... total machine lockup :)

Someone will have to regenerate the autoconf stuff as I've changed 
configure.in.
vls-cvs-dvb.patch (text/x-diff, 2.3 KB)
--- vls.orig/src/modules/dvbinput/dvbinput.cpp	2003-08-11 11:15:48.000000000 +0100
+++ vls/src/modules/dvbinput/dvbinput.cpp	2003-08-08 19:41:00.000000000 +0100
@@ -110,7 +110,7 @@
                                 C_TsDemux(&m_cTsProvider),
                                 m_cTsProvider(500),
                                 m_cInputProgram(/*0,*/ "Input DVB " + strName),
-                                m_cInputBroadcast(&m_cInputProgram, this, NULL),
+                                m_cInputBroadcast(&m_cInputProgram, this, NULL, strName),
                                 m_cPatDecoder(&m_cTsProvider, this),
                                 m_cCurrentPat(0, 0, true)
 {
--- vls.orig/src/modules/dvbreader/dvbreader.cpp	2003-08-11 11:15:48.000000000 +0100
+++ vls/src/modules/dvbreader/dvbreader.cpp	2003-08-11 11:20:26.000000000 +0100
@@ -124,15 +124,23 @@
   {
     if(poll(pfd, 1, 10000))
     { 
-      if(pfd[0].revents & POLLIN) { iRc=read(m_hFd, pBuff, 188);}
-      else if (!m_bIgnoreTimeout)return MPEG_STREAMERROR;
+      if(pfd[0].revents & POLLIN) { 
+	iRc=read(m_hFd, pBuff, 188);
+      } else {
+        if (m_bIgnoreTimeout) {
+          sleep(1);
+	} else {
+          return MPEG_STREAMERROR;
     }
-    else if (!m_bIgnoreTimeout)
-    {
+      }
+    } else {
+      if (m_bIgnoreTimeout) {
+        sleep(1);
+      } else {
           Log(m_hLog, LOG_NOTE, "Time out !\n");
           return MPEG_STREAMERROR;
     }
-        
+    }
   }
   return iRc;
  
--- vls.orig/configure.in	2003-08-11 11:15:47.000000000 +0100
+++ vls/configure.in	2003-08-09 00:17:39.000000000 +0100
@@ -356,9 +356,9 @@
 
   dnl Test for the libdvb library
   AC_MSG_CHECKING(for libdvb headers in ${with_libdvb})
-    if test "x$with_dvb" != x
+    if test "x$with_libdvb" != x
     then
-      test_CFLAGS="-I${with_libdvb}"
+      test_CFLAGS="-I${with_libdvb}/include -I${with_libdvb}"
     fi
     save_CPPFLAGS=$CPPFLAGS
     CPPFLAGS="$save_CPPFLAGS $test_CFLAGS $DVBINPUT_CCFLAGS"
@@ -373,7 +373,7 @@
     if test -f "${with_libdvb}/libdvb.a"
     then
       DVBINPUT_LIB="${DVBINPUT_LIB} -ldvb"
-      DVBINPUT_DCFLAGS="${DVBINPUT_DCFLAGS} -I${with_libdvb}"
+      DVBINPUT_DCFLAGS="${DVBINPUT_DCFLAGS} -I${with_libdvb}/include -I${with_libdvb}"
       DVBINPUT_LCFLAGS="${DVBINPUT_LCFLAGS} -L${with_libdvb}"
       PLUGINS="${PLUGINS} dvbinput dvbreader"
     else