From 0e138cc0f370bc38c3dc197a43df2d010b547648 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Thu, 10 Aug 2017 10:21:40 -0400 Subject: [PATCH] niimaqdxsrc: avoid error if no attributes exist --- sys/niimaqdx/gstniimaqdx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/niimaqdx/gstniimaqdx.c b/sys/niimaqdx/gstniimaqdx.c index 2fe45f8..ce4ad47 100644 --- a/sys/niimaqdx/gstniimaqdx.c +++ b/sys/niimaqdx/gstniimaqdx.c @@ -939,11 +939,11 @@ gst_niimaqdxsrc_set_dx_attributes (GstNiImaqDxSrc * src) int i; IMAQdxError rval; - if (!src->attributes) { + if (!src->attributes || src->attributes == 0) { return; } - GST_DEBUG_OBJECT (src, "Trying to set following attributes: %s", + GST_DEBUG_OBJECT (src, "Trying to set following attributes: '%s'", src->attributes); pairs = g_strsplit (src->attributes, ";", 0); @@ -1203,6 +1203,7 @@ gst_niimaqdxsrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps) src->gst_framesize = src->gst_row_stride * src->height; + /* TODO: don't use default_alloc, app can change blocksize */ gst_base_src_set_blocksize (bsrc, src->gst_framesize); if (src->temp_buffer)