Mailing List archive

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

[vdr] Re: can the osd be accessed by a separate pthread?



Klaus Schmidinger wrote:

Clemens Kirchgatterer wrote:

Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de> wrote:


Clemens Kirchgatterer wrote:

as i have already said: that is not the plugins fault. have you
tried this with any other plugin that opens an raw osd? i.e. with
klaus' own osddemo plugin?

Sorry, but it _is_ the plugin's fault!

A plugin that wants to open a raw OSD shall return a derived
cOsdObject from its MainMenuAction() function. VDR will then call that
object's Show() function and in _there_ the derived cOsdObject may
call cOsd::OpenRaw()(and nowhere else!).

are you absolutly shure, that there is a difference between opening
the RawOsd in cOsdObject->Show() as you say and doing it in a thread
spawned from cOsdObject->Show() ? i can't see why this should matter.

You're right, this shouldn't matter..

Ok this means the rule is. OpenRaw must only be called after cOsdObject->Show() has been called, but before the destructor of

cOsdObject is called. In the destructor the osd must be closed.

And it is the case, that an StatusMessage issued from svdrsend.pl results in the desctruction of the current
cOsdObject ?


The plugin has to make sure that it has deleted the osd before the

destructor returns. If the osd has been allocated in the thread, the
destructor has to make sure that the thread has completely ended and released
the osd _before_ it returns.

Klaus

Hmm the race condition ist there. The destructor of tetris just set the running flag to false and returns at once,
while the thread is still running for a while and access the osd. the result is a disturbed picture and sound and wrong osd display
of a status message.

Well, now i understood how i can use the osd from a separate thread and do not interfere with vdr core.

thanks for the discussion of the topic.

this should really be added to PLUGINS.html. ;-)


regards,
gunnar







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



Home | Main Index | Thread Index