[vdr] priorities < 0

Frank Schmirler vdr at schmirler.de
Thu Sep 23 15:10:12 CEST 2010

Hi Rainer,

On Thu, 23 Sep 2010 11:11:35 +0200, Rainer Blickle wrote
> i have a question regarding receivers with priority < 0.
> I have taken a look at cDvbDevice::ProvidesChannel (1.7.15). When
> priority is < 0 hasPriority gets set to true even if there are other
> receivers for a different channel. In this case NeedsDetachReceivers
> is set to false.
> If cDvbDevice::ProvidesChannel is called with a priority < 0, then 
> the Channel parameter has to be the Channel currently receiving on 
> the device.
> Why: If the cDvbDevice::ProvidesChannel is called with priority < 0
> and a channel other than the current receiving, needsDetachReceived
> would be kept to false, the receiver would be added the the list of
> receivers, but the channel doesn't get switched.
> Or does the Channel doesn't matter if the priority is < 0 ?
> My question: is my assumption correct ?

I stumbled across this a while ago, too. A negative priority changes the
semantics of this function. From the documentation of ProvidesChannel in device.h:

  The special Priority value -1 will tell the caller whether this device
  is principally able to provide the given Channel, regardless of any
  attached cReceivers.

The only place in VDR where ProvidesChannel is called is from GetDevice. As a
consequence GetDevice should never be called with a negative priority (even
though GetDevice support priorities down to -99). This is somewhat unexpected.
Negative priorities are used for receivers which may be detached anytime. If
I'd been looking for an idle device for tuning some channel and attaching a
receiver with negative priority, I would have used a GetDevice call with
negative priority...


More information about the vdr mailing list