From 7fe786135f878dc9af5646b7b2d14ad591864b02 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 6 Jan 2024 09:45:42 -0300 Subject: [PATCH] validate: scenario: Do not use a NULL scenario description structure The scenario meta is optional and we have to take that into account. Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3199 Part-of: --- .../gst/validate/gst-validate-scenario.c | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c index c1923256bb..74ffc2aef6 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c @@ -5941,24 +5941,27 @@ gst_validate_scenario_new (GstValidateRunner * GstClockTime base_time, start_time; gboolean use_system_clock = FALSE; - if (gst_validate_utils_get_clocktime (scenario->description, "base-time", - &base_time)) { - gst_validate_printf (NULL, - "**-> Setting %" GST_PTR_FORMAT " base time to %" GST_TIMEP_FORMAT - "**\n", pipeline, &base_time); - gst_element_set_base_time (GST_ELEMENT (pipeline), base_time); + if (scenario->description) { + if (gst_validate_utils_get_clocktime (scenario->description, "base-time", + &base_time)) { + gst_validate_printf (NULL, + "**-> Setting %" GST_PTR_FORMAT " base time to %" GST_TIMEP_FORMAT + "**\n", pipeline, &base_time); + gst_element_set_base_time (GST_ELEMENT (pipeline), base_time); + } + + if (gst_validate_utils_get_clocktime (scenario->description, "start-time", + &start_time)) { + gst_validate_printf (NULL, + "**-> Setting %" GST_PTR_FORMAT " start time to %" GST_TIMEP_FORMAT + "**\n", pipeline, &base_time); + gst_element_set_start_time (GST_ELEMENT (pipeline), start_time); + } + + gst_structure_get_boolean (scenario->description, "use-system-clock", + &use_system_clock); } - if (gst_validate_utils_get_clocktime (scenario->description, "start-time", - &start_time)) { - gst_validate_printf (NULL, - "**-> Setting %" GST_PTR_FORMAT " start time to %" GST_TIMEP_FORMAT - "**\n", pipeline, &base_time); - gst_element_set_start_time (GST_ELEMENT (pipeline), start_time); - } - - gst_structure_get_boolean (scenario->description, "use-system-clock", - &use_system_clock); if (scenario->priv->clock) { if (use_system_clock) gst_validate_abort