[gst-devel] g_return_val_if_fail usage in dparams
Steve Baker
steve at stevebaker.org
Tue Jan 4 22:20:24 CET 2005
I have no problem with this change.
cheers
On Mon, 2005-01-03 at 20:32 +0100, Stefan Kost wrote:
> hi hi,
>
> even though the current dparams will be replaced, the current implementation has
> something I consider as a flaw.
> No only incomming parameters are checked with g_return_val_if_fail(), also
> during the method this used. The problem is that during unit test this causes
> the test to fail, without that one can check for it.
>
> The specific case is dparammanager.c::gst_dpman_get_dparam().
> If name is nonsense a method that is invoked will return NULL and therefore the
> method will abort with a CRITICAL instead of just returning NULL, so that the
> callee could handle the problem.
> Infact GError could be used to give the callee detail what has caused the error.
>
> To avoid API changes, I would like to change those
> g_return_val_if_fail(dpwrap != NULL, NULL);
> statements into
> if(!dpwrap) {
> GST_INFO("invalid dparam name");
> return(NULL);
> }
>
> Any objections? Steve?
>
> Ciao
> Stefan
More information about the gstreamer-devel
mailing list