Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] cReceivers in plugins



Hi,

I stumbled on a thing I don't really know how to work around when using
plugins. A little cReceiver subclass that I have gets attached to the
primary device using code like:

    m_receiver = new cReceiver(...);

    if ( cDevice::PrimaryDevice()->AttachReceiver ( m_receiver )) {
        // attach was ok
        .... 
    }

This always succeeds, but the receiver never gets activated, ie its
Activate() method is never called. It turns out that at the time the
plugins are started (Start() is called) the primary device is not yet
created, so thus cDevice::AttachReceiver() will do this:

bool cDevice::AttachReceiver(cReceiver *Receiver)
{
  if (!Receiver)
     return false;
  if (Receiver->device == this) {
      return true;
  }

  // here we activate the receiver
}

But "this" is null at this point, as is Receiver->device so the attach
seems to succeed, but the attach isn't really done.

What can be done to make a plugin start after the privary device is
initialized? Activating the plugin later from the menu is a kludge (that
would work, of course), and makes it harder to test (can't really do it
over ssh, need access to the remote control and TV, which means sneakernet
traffic).

I'm sorry if this is a stupid question.

-- 
                        "Bingeley bingeley beep!"
               -- The Personal Disorganizer, Terry Pratchett in Feet of Clay



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index