validate-scenario: Fix string usage

Use the string representation of the index if it *IS* present (and
not the opposite).

CID #1415506
This commit is contained in:
Edward Hervey 2017-07-18 15:43:26 +02:00 committed by Edward Hervey
parent 5b54127c5a
commit e5903f1d05

View 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;