[gupnp] problem with GUPnPLastChangeParser



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. Do I miss something obvious
here or is this a severe design flaw in the GUPnPLastChangeParser API?


Sven


--
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]