Applied and removed respect_ca patch

This commit is contained in:
schmirl 2008-04-07 15:07:38 +00:00
parent 9c60fb4e42
commit c6c2344fef
4 changed files with 12 additions and 46 deletions

View File

@ -1,6 +1,8 @@
VDR Plugin 'streamdev' Revision History VDR Plugin 'streamdev' Revision History
--------------------------------------- ---------------------------------------
- applied and removed respect_ca patch
2008-04-07: Branched v0_4 2008-04-07: Branched v0_4
- changed location of streamdevhosts.conf to VDRCONFDIR/plugins/streamdev - changed location of streamdevhosts.conf to VDRCONFDIR/plugins/streamdev

View File

@ -1,5 +1,5 @@
/* /*
* $Id: device.c,v 1.18 2008/04/07 14:50:32 schmirl Exp $ * $Id: device.c,v 1.18.2.1 2008/04/07 15:07:39 schmirl Exp $
*/ */
#include "client/device.h" #include "client/device.h"
@ -54,6 +54,12 @@ cStreamdevDevice::~cStreamdevDevice() {
DELETENULL(m_TSBuffer); DELETENULL(m_TSBuffer);
} }
int cStreamdevDevice::ProvidesCa(const cChannel *Channel) const
{
// Encrypted is acceptable for now. Will ask the server later.
return Channel->Ca() <= CA_DVB_MAX ? cDevice::ProvidesCa(Channel) : 1;
}
bool cStreamdevDevice::ProvidesSource(int Source) const { bool cStreamdevDevice::ProvidesSource(int Source) const {
Dprintf("ProvidesSource, Source=%d\n", Source); Dprintf("ProvidesSource, Source=%d\n", Source);
return true; return true;
@ -88,7 +94,7 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority,
if (ClientSocket.DataSocket(siLive) != NULL if (ClientSocket.DataSocket(siLive) != NULL
&& TRANSPONDER(Channel, m_Channel)) && TRANSPONDER(Channel, m_Channel))
res = true; res = true;
else { else if (ProvidesCa(Channel)) {
res = prio && ClientSocket.ProvidesChannel(Channel, Priority); res = prio && ClientSocket.ProvidesChannel(Channel, Priority);
ndr = true; ndr = true;
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: device.h,v 1.7 2008/04/07 14:40:39 schmirl Exp $ * $Id: device.h,v 1.7.2.1 2008/04/07 15:07:39 schmirl Exp $
*/ */
#ifndef VDR_STREAMDEV_DEVICE_H #ifndef VDR_STREAMDEV_DEVICE_H
@ -49,6 +49,7 @@ public:
cStreamdevDevice(void); cStreamdevDevice(void);
virtual ~cStreamdevDevice(); virtual ~cStreamdevDevice();
virtual int ProvidesCa(const cChannel *Channel) const;
virtual bool ProvidesSource(int Source) const; virtual bool ProvidesSource(int Source) const;
virtual bool ProvidesTransponder(const cChannel *Channel) const; virtual bool ProvidesTransponder(const cChannel *Channel) const;
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1,

View File

@ -1,43 +0,0 @@
# The cannels.conf ca field can be used to bind a channel to a specific
# device. The streamdev-client does not consider this information, so
# there's no way to keep VDR from using streamdev for a specific
# channel. Apply this patch if you need this feature.
#
# This fix should probably become part of streamdev. However as it
# changes the behaviour of streamdev, I decided to keep it as a separate
# patch until there is something like a new official streamdev release.
#
--- client/device.h.bak 2006-11-09 12:25:21.000000000 +0100
+++ client/device.h 2006-11-09 12:26:57.000000000 +0100
@@ -50,6 +50,7 @@
cStreamdevDevice(void);
virtual ~cStreamdevDevice();
+ virtual int ProvidesCa(const cChannel *Channel) const;
virtual bool ProvidesSource(int Source) const;
virtual bool ProvidesTransponder(const cChannel *Channel) const;
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1,
--- client/device.c.bak 2006-11-09 12:23:24.000000000 +0100
+++ client/device.c 2006-11-09 12:35:48.000000000 +0100
@@ -57,6 +57,12 @@
#endif
}
+int cStreamdevDevice::ProvidesCa(const cChannel *Channel) const
+{
+ // Encrypted is acceptable for now. Will ask the server later.
+ return Channel->Ca() <= CA_DVB_MAX ? cDevice::ProvidesCa(Channel) : 1;
+}
+
bool cStreamdevDevice::ProvidesSource(int Source) const {
Dprintf("ProvidesSource, Source=%d\n", Source);
return false;
@@ -78,7 +84,7 @@
if (ClientSocket.DataSocket(siLive) != NULL
&& TRANSPONDER(Channel, m_Channel))
res = true;
- else {
+ else if (ProvidesCa(Channel)) {
res = prio && ClientSocket.ProvidesChannel(Channel, Priority);
ndr = true;
}