From 99eaad17e25ee37e48b6f665e80c31f5b3d32325 Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Fri, 8 Mar 2019 15:44:31 +0100
Subject: [PATCH] validate: fix pause duration handling
Commit 394242c2248a ("validate:scenario: Enhance variable
implementation") caused the duration parameter to be stored
as a double instead of GstClockTime, which the _execute_pause
implementation expects. Fix the parameter type and use
gst_validate_action_get_clocktime to handle duration correctly.
https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/73
---
validate/gst/validate/gst-validate-scenario.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c
index 0480bb4518..c6aa5ad1e5 100644
--- a/validate/gst/validate/gst-validate-scenario.c
+++ b/validate/gst/validate/gst-validate-scenario.c
@@ -847,8 +847,7 @@ _execute_pause (GstValidateScenario * scenario, GstValidateAction * action)
GstClockTime duration = 0;
GstValidateExecuteActionReturn ret;
- gst_structure_get (action->structure, "duration", G_TYPE_UINT64, &duration,
- NULL);
+ gst_validate_action_get_clocktime (scenario, action, "duration", &duration);
gst_structure_set (action->structure, "state", G_TYPE_STRING, "paused", NULL);
GST_INFO_OBJECT (scenario, "Pausing for %" GST_TIME_FORMAT,
@@ -4806,7 +4805,7 @@ init_scenarios (void)
.name = "duration",
.description = "The duration during which the stream will be paused",
.mandatory = FALSE,
- .types = "double",
+ .types = "double or string (GstClockTime)",
.possible_variables = NULL,
.def = "0.0",
},