validate-scenario: Fix string usage
authorEdward Hervey <edward@centricular.com>
Tue, 18 Jul 2017 13:43:26 +0000 (15:43 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 18 Jul 2017 13:43:26 +0000 (15:43 +0200)
Use the string representation of the index if it *IS* present (and
not the opposite).

CID #1415506

validate/gst/validate/gst-validate-scenario.c

index 3cbd085..c41f73c 100644 (file)
@@ -999,8 +999,9 @@ execute_switch_track_default (GstValidateScenario * scenario,
     GstPad *pad, *cpad, *srcpad;
 
     ret = GST_VALIDATE_EXECUTE_ACTION_OK;
+    str_index = gst_structure_get_string (action->structure, "index");
 
-    if ((str_index = gst_structure_get_string (action->structure, "index"))) {
+    if (str_index == NULL) {
       if (!gst_structure_get_uint (action->structure, "index", &index)) {
         GST_WARNING ("No index given, defaulting to +1");
         index = 1;