[gstreamer-bugs] [Bug 640878] g_object_set() for a plug-in property
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Sat Jan 29 10:08:20 PST 2011
https://bugzilla.gnome.org/show_bug.cgi?id=640878
GStreamer | gstreamer (core) | unspecified
Tim-Philipp Müller <t.i.m> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |t.i.m at zen.co.uk
Resolution| |INVALID
Target Milestone|HEAD |NONE
--- Comment #2 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2011-01-29 18:08:15 UTC ---
> the below statement throws a warning:
> g_object_set(G_OBJECT(plugin), "property1", 451260000, NULL);
>
> and the warning is:
> GLib-GObject-WARNING **: IA__g_object_set_valist: object class `plugin'
> has no property named "<_my_function_name>"
>
> ------------------------------------------------------......
> if it is tried as below, it works
> gint64 max = 451260000;
> g_object_set(G_OBJECT(plugin), "property1", max, NULL);
>
> why this happens?
Because g_object_set() is a vararg function that expects the parameters passed
to be exactly of the type that the property is. The compiler doesn't know in
this case that 451260000 is supposed to be a 64-bit integer, and will hence
just pass a normal integer, which means that parsing will be messed up and the
NULL terminator won't be recognised properly, so it'll just continue looking
for arguments. You're lucky that you just get that warning and not a crash.
This is not a bug, closing. If you have further questions, please ask on the
mailing list, thanks!
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the Gstreamer-bugs
mailing list