summaryrefslogtreecommitdiff
path: root/patches/vdr-1.4.0-closefilter.patch
blob: cd87632c5f27d0bd133b9b4888a1fd8a1605a7d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Index: device.c
===================================================================
--- device.c	(Revision 10449)
+++ device.c	(Arbeitskopie)
@@ -724,6 +724,11 @@
   return -1;
 }
 
+void cDevice::CloseFilter(int Handle)
+{
+  close(Handle);
+}
+
 void cDevice::AttachFilter(cFilter *Filter)
 {
   if (sectionHandler)
Index: device.h
===================================================================
--- device.h	(Revision 10449)
+++ device.h	(Arbeitskopie)
@@ -326,6 +326,11 @@
        ///< Opens a file handle for the given filter data.
        ///< A derived device that provides section data must
        ///< implement this function.
+  virtual void CloseFilter(int Handle);
+       ///< Closes a file handle that has previously been opened
+       ///< by OpenFilter(). If this is as simple as calling close(Handle),
+       ///< a derived class need not implement this function, because this
+       ///< is done by the default implementation.
   void AttachFilter(cFilter *Filter);
        ///< Attaches the given filter to this device.
   void Detach(cFilter *Filter);
Index: sections.c
===================================================================
--- sections.c	(Revision 10449)
+++ sections.c	(Arbeitskopie)
@@ -105,7 +105,7 @@
   for (fh = filterHandles.First(); fh; fh = filterHandles.Next(fh)) {
       if (fh->filterData.Is(FilterData->pid, FilterData->tid, FilterData->mask)) {
          if (--fh->used <= 0) {
-            close(fh->handle);
+            device->CloseFilter(fh->handle);
             filterHandles.Del(fh);
             break;
             }