From a1d2cea9135d6a2fa3f6ec2c8eb9ceaa8d74b093 Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Sat, 1 May 2021 16:52:22 -0400 Subject: [PATCH] ges: validate: Use correct types when getting structure values From https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/247 Part-of: --- .../gst-editing-services/ges/ges-validate.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-editing-services/ges/ges-validate.c b/subprojects/gst-editing-services/ges/ges-validate.c index 3b666ed5a8..7d7698698b 100644 --- a/subprojects/gst-editing-services/ges/ges-validate.c +++ b/subprojects/gst-editing-services/ges/ges-validate.c @@ -367,11 +367,15 @@ GES_START_VALIDATE_ACTION (_edit) REPORT_UNLESS (element, beach, "Could not find element %s", element_name); if (!_get_clocktime (action->structure, "position", &position, &fposition)) { - fposition = 0; - if (!gst_structure_get_int (action->structure, "source-frame", - (gint *) & fposition) - && !gst_structure_get_int64 (action->structure, "source-frame", - &fposition)) { + gint pos; + gint64 pos64; + + if (gst_structure_get_int (action->structure, "source-frame", &pos)) { + fposition = pos; + } else if (gst_structure_get_int64 (action->structure, "source-frame", + &pos64)) { + fposition = pos64; + } else { gchar *structstr = gst_structure_to_string (action->structure); GST_VALIDATE_REPORT_ACTION (scenario, action,