1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00
vdr-plugin-iptv/patches/vdr-1.5.9-closefilter.patch

106 lines
4.0 KiB
Diff

diff -Nru vdr-1.5.9-vanilla/PLUGINS.html vdr-1.5.9-closefilter/PLUGINS.html
--- vdr-1.5.9-vanilla/PLUGINS.html 2007-08-24 16:45:02.000000000 +0300
+++ vdr-1.5.9-closefilter/PLUGINS.html 2007-09-28 17:57:47.484049900 +0300
@@ -1778,7 +1778,7 @@
<p><table><tr><td bgcolor=#F0F0F0><pre>
virtual bool ProvidesSource(int Source) const;
virtual bool ProvidesTransponder(const cChannel *Channel) const;
-virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL);
+virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
</pre></td></tr></table><p>
@@ -1838,7 +1838,7 @@
functionality:
<p><table><tr><td bgcolor=#F0F0F0><pre>
-virtual bool GrabImage(const char *FileName, bool Jpeg = true, int Quality = -1, int Si
+virtual bool GrabImage(const char *FileName, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
virtual void SetVideoFormat(bool VideoFormat16_9);
virtual void SetVolumeDevice(int Volume);
</pre></td></tr></table><p>
@@ -1846,14 +1846,15 @@
<p>
<b>Section Filtering</b>
<p>
-If your device provides section filtering capabilities it can implement
-the function
+If your device provides section filtering capabilities it can implement
+functions
<p><table><tr><td bgcolor=#F0F0F0><pre>
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
+virtual bool CloseFilter(int Handle);
</pre></td></tr></table><p>
-which must open a file handle that delivers section data for the given
+which must open and close a file handle that delivers section data for the given
filter parameters.
<p>
In order to actually start section handling, the
diff -Nru vdr-1.5.9-vanilla/device.c vdr-1.5.9-closefilter/device.c
--- vdr-1.5.9-vanilla/device.c 2007-08-26 14:11:42.000000000 +0300
+++ vdr-1.5.9-closefilter/device.c 2007-09-28 17:53:49.734049900 +0300
@@ -576,6 +576,11 @@
return -1;
}
+bool cDevice::CloseFilter(int Handle)
+{
+ return false;
+}
+
void cDevice::AttachFilter(cFilter *Filter)
{
if (sectionHandler)
diff -Nru vdr-1.5.9-vanilla/device.h vdr-1.5.9-closefilter/device.h
--- vdr-1.5.9-vanilla/device.h 2007-07-22 14:20:13.000000000 +0300
+++ vdr-1.5.9-closefilter/device.h 2007-09-28 17:53:49.749674900 +0300
@@ -303,6 +303,8 @@
///< Opens a file handle for the given filter data.
///< A derived device that provides section data must
///< implement this function.
+ virtual bool CloseFilter(int Handle);
+ ///< Closes a file handle
void AttachFilter(cFilter *Filter);
///< Attaches the given filter to this device.
void Detach(cFilter *Filter);
diff -Nru vdr-1.5.9-vanilla/dvbdevice.c vdr-1.5.9-closefilter/dvbdevice.c
--- vdr-1.5.9-vanilla/dvbdevice.c 2007-08-17 16:37:56.000000000 +0300
+++ vdr-1.5.9-closefilter/dvbdevice.c 2007-09-28 17:53:49.765299900 +0300
@@ -711,6 +711,11 @@
return -1;
}
+bool cDvbDevice::CloseFilter(int Handle)
+{
+ return (close(Handle) == 0);
+}
+
void cDvbDevice::TurnOffLiveMode(bool LiveView)
{
if (LiveView) {
diff -Nru vdr-1.5.9-vanilla/dvbdevice.h vdr-1.5.9-closefilter/dvbdevice.h
--- vdr-1.5.9-vanilla/dvbdevice.h 2007-02-25 14:23:57.000000000 +0200
+++ vdr-1.5.9-closefilter/dvbdevice.h 2007-09-28 17:53:49.765299900 +0300
@@ -83,6 +83,7 @@
protected:
virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
+ virtual bool CloseFilter(int Handle);
// Common Interface facilities:
diff -Nru vdr-1.5.9-vanilla/sections.c vdr-1.5.9-closefilter/sections.c
--- vdr-1.5.9-vanilla/sections.c 2005-09-18 14:30:29.000000000 +0300
+++ vdr-1.5.9-closefilter/sections.c 2007-09-28 17:53:49.780924900 +0300
@@ -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;
}