[Fix] add type checking for gst value in tensor_converter.c
authorDongju Chae <dongju.chae@samsung.com>
Thu, 30 Jan 2020 04:55:55 +0000 (13:55 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 31 Jan 2020 06:01:30 +0000 (15:01 +0900)
This commit adds type checking for the gst value, supported_formats.
When an unsupported colorspace is used, gst_value_list_get_size() has
generated unnecessary warnings.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
gst/nnstreamer/tensor_converter/tensor_converter.c

index 8c2f821..b206ee5 100644 (file)
@@ -1244,7 +1244,8 @@ gst_tensor_converter_get_possible_media_caps (GstTensorConverter * self)
                   break;
               }
 
-              if (gst_value_list_get_size (&supported_formats) > 0) {
+              if (G_VALUE_TYPE (&supported_formats) == GST_TYPE_LIST &&
+                  gst_value_list_get_size (&supported_formats) > 0) {
                 gst_structure_set_value (st, "format", &supported_formats);
               }
               g_value_unset (&supported_formats);