Re: [gupnp] problem with GUPnPLastChangeParser



On Wed, Apr 29, 2009 at 6:52 PM, Sven Neumann <s neumann raumfeld com> wrote:
> Hi,
>
> I figured that there's a problem with the GUPnPLastChangeParser API. A
> LastChange notification usually contains only a few changed values,
> quite often only a single one. The code that parses the LastChange event
> does not know which values have changed and thus will usually parse for
> all known state variables. Let's look at a simple example, the
> LastChange event of a RenderingControl service:
>
>  GUPnPLastChangeParser *parser = gupnp_last_change_parser_new ();
>  guint                  volume = G_MAXUINT;
>  gboolean               mute   = -1;
>
>  gupnp_last_change_parser_parse_last_change (parser, 0, xml, NULL,
>                                   "Volume", G_TYPE_UINT,    &volume,
>                                   "Mute",   G_TYPE_BOOLEAN, &mute,
>                                   NULL);
>
> Note how I initialized the volume and mute variables to special values
> so that I can figure out later if they have been changed. That already
> is pretty much a kludge, but I don't see what else I could do. However
> not even that works, as the implementation of
> gupnp_last_change_parser_parse_last_change() will always initialize each
> of the passed values to a default value.

   The parser shouldn't be modifying your variables if it doesn't find
the related variables. If it does, it's a bug, not a design flaw. :)

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124
--
To unsubscribe send a mail to gupnp+unsubscribe\@o-hand.com



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