[vdr] calling MainMenuAction() from an other plugin

Reinhard Nissl rnissl at gmx.de
Tue Mar 28 23:03:00 CEST 2006


Hi,

Udo Richter wrote:

>>> if (ShowMessage && !Skins.IsOpen() && !cOsd::IsOpen()) {
>>>    ShowMessage = false;
>>>    cRemote::CallPlugin("myShowMessage");
>>>    }
>>
>> this looks racy to me. What if two different threads do this?
>> The OSD could open between the if () and ::CallPlugin
> 
> CallPlugin is always racy, as only one plugin call will be remembered.
> 
> The only safe way is to set up a signal and wait for MainMenuAction 
> being called. If it is not called within timeout, try again.
> 
> The IsOpen() calls should ideally be made from foreground thread, but 
> usually there's no way to get there. Testing from within MainMenuAction 
> is pointless, as OSD and menu get closed right before MainMenuAction.

I did something similar in my vdr-xine plugin. Things could be improved 
using the attached patch.

It allows to remember up to 16 calls to different plugins and the caller 
can detect, whether putting the call in the remote key fifo was successful.

Bye.
-- 
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl at gmx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vdr-1.3.44-remote.patch
Type: text/x-patch
Size: 2201 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/vdr/attachments/20060328/2f2dc82c/vdr-1.3.44-remote.bin


More information about the vdr mailing list