#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_hvr1600.dpatch by Tobias Grimm <etobi@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: HVR 1600 support

@DPATCH@
diff -urNad vdr-plugin-pvrinput-2008-10-04~/device.c vdr-plugin-pvrinput-2008-10-04/device.c
--- vdr-plugin-pvrinput-2008-10-04~/device.c	2008-10-04 10:04:03.000000000 +0200
+++ vdr-plugin-pvrinput-2008-10-04/device.c	2009-01-10 00:36:17.000000000 +0100
@@ -33,7 +33,7 @@
   log(3, "%s = %s", *devName, video_vcap.card);
   BusID = cString::sprintf("%s", video_vcap.bus_info);
   log(3, "BusID = %s", *BusID);
-  if      ((!memcmp(video_vcap.driver, "ivtv",4)) || (!memcmp(video_vcap.driver, "IVTV",4)))   driver = ivtv;
+  if      ((!memcmp(video_vcap.driver, "ivtv",4)) || (!memcmp(video_vcap.driver, "IVTV",4)) || (!memcmp(video_vcap.driver, "cx18",4)))   driver = ivtv;
   else if  (!memcmp(video_vcap.driver, "pvrusb2",7))                                           driver = pvrusb2;
   else if  (!memcmp(video_vcap.driver, "cx88_blackbird",14))                                   driver = cx88_blackbird;
   else { driver = undef; log(3, "%s",video_vcap.driver); } 
@@ -104,6 +104,7 @@
       numInputs++;
       }
     if      (!memcmp(input.name, "Tuner",        5)) { inputs[eTelevision]=inputs[eRadio]=i; continue; } //ivtv:   Radio and TV tuner are same input.
+    else if (!memcmp(input.name, "Tuner 1",      7)) { inputs[eTelevision]=i; continue; }                //cx18
     else if (!memcmp(input.name, "television",  10)) { inputs[eTelevision]=i; continue; }                //pvrusb2
     else if (!memcmp(input.name, "Television",  10)) { inputs[eTelevision]=i; continue; }                //cx88_blackbird
     else if (!memcmp(input.name, "radio",        5)) { inputs[eRadio]     =i; continue; }                //pvrusb2
@@ -166,6 +167,7 @@
   if (v4l2_fd) {
     IOCTL(v4l2_fd, VIDIOC_QUERYCAP, &vcap);
     if (!memcmp(vcap.driver, "ivtv",4) ||
+        !memcmp(vcap.driver, "cx18",4) ||
         !memcmp(vcap.driver, "pvrusb2", 7))
        found = true;
     if (!memcmp(vcap.driver, "cx88_blackbird", 14)) {
