From: Rob C. <ro...@ti...> - 2009-11-06 02:33:44
|
On Nov 5, 2009, at 3:21 PM, Stefan Kost wrote: > Rob Clark schrieb: >> Signed-off-by: Rob Clark <ro...@ti...> >> --- >> omx/gstomx_base_filter.c | 24 ++------ >> omx/gstomx_base_sink.c | 21 ++------ >> omx/gstomx_base_src.c | 22 ++------ >> omx/gstomx_util.c | 133 ++++++++++++++++++++++++++++++++++ >> +----------- >> omx/gstomx_util.h | 12 +++-- >> 5 files changed, 123 insertions(+), 89 deletions(-) >> > >> void >> -g_omx_core_init (GOmxCore *core, >> - const gchar *library_name, >> - const gchar *component_name) >> +g_omx_core_init (GOmxCore *core) >> { >> + gchar *library_name=NULL, *component_name=NULL; >> + >> + if (core->omx_handle) >> + return; >> + >> + GST_DEBUG_OBJECT (core->object, "loading: %s (%s)", >> component_name, library_name); >> + >> + g_object_get (core->object, >> + "component-name", &component_name, >> + "library-name", &library_name, >> + NULL); >> + >> + g_return_if_fail (component_name); >> + g_return_if_fail (library_name); >> + >> core->imp = request_imp (library_name); >> > > just use g_assert here, if that is never supposed to fail. > g_return_if_fail is > to handle external wrong api usage (things that you can't control), > and g_assert > is for own mistakes. People who are using stable releases of a > software would > turn the assert off. When they ship their product and its well > tested, they > could turn the g_return_if_fail off too (if there are not going to > be other > users of the library). > agreed.. should be g_assert since this is never supposed to fail.. when I re-submit, I'll change this. BR, -R |