mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
validate-scenario: Handle non-set env variable
Nothing guarantees it's present/set
This commit is contained in:
parent
50d3d08ab5
commit
34a5946e6b
1 changed files with 10 additions and 5 deletions
|
@ -618,8 +618,10 @@ get_position (GstValidateScenario * scenario)
|
||||||
MAX (0, (gint64) (priv->segment_start - priv->seek_pos_tol));
|
MAX (0, (gint64) (priv->segment_start - priv->seek_pos_tol));
|
||||||
stop_with_tolerance =
|
stop_with_tolerance =
|
||||||
priv->segment_stop != -1 ? priv->segment_stop + priv->seek_pos_tol : -1;
|
priv->segment_stop != -1 ? priv->segment_stop + priv->seek_pos_tol : -1;
|
||||||
if ((GST_CLOCK_TIME_IS_VALID (stop_with_tolerance) && position > stop_with_tolerance)
|
if ((GST_CLOCK_TIME_IS_VALID (stop_with_tolerance)
|
||||||
|| (priv->seek_flags & GST_SEEK_FLAG_ACCURATE && position < start_with_tolerance)) {
|
&& position > stop_with_tolerance)
|
||||||
|
|| (priv->seek_flags & GST_SEEK_FLAG_ACCURATE
|
||||||
|
&& position < start_with_tolerance)) {
|
||||||
|
|
||||||
GST_VALIDATE_REPORT (scenario, QUERY_POSITION_OUT_OF_SEGMENT,
|
GST_VALIDATE_REPORT (scenario, QUERY_POSITION_OUT_OF_SEGMENT,
|
||||||
"Current position %" GST_TIME_FORMAT " not in the expected range [%"
|
"Current position %" GST_TIME_FORMAT " not in the expected range [%"
|
||||||
|
@ -1305,14 +1307,17 @@ gst_validate_list_scenarios (gchar * output_file)
|
||||||
gsize datalength;
|
gsize datalength;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
GKeyFile *kf = NULL;
|
GKeyFile *kf = NULL;
|
||||||
gchar **env_scenariodir =
|
const gchar *envvar;
|
||||||
g_strsplit (g_getenv ("GST_VALIDATE_SCENARIOS_PATH"), ":",
|
gchar **env_scenariodir = NULL;
|
||||||
0);
|
|
||||||
gchar *tldir = g_build_filename (g_get_user_data_dir (),
|
gchar *tldir = g_build_filename (g_get_user_data_dir (),
|
||||||
"gstreamer-" GST_API_VERSION, GST_VALIDATE_SCENARIO_DIRECTORY,
|
"gstreamer-" GST_API_VERSION, GST_VALIDATE_SCENARIO_DIRECTORY,
|
||||||
NULL);
|
NULL);
|
||||||
GFile *dir = g_file_new_for_path (tldir);
|
GFile *dir = g_file_new_for_path (tldir);
|
||||||
|
|
||||||
|
envvar = g_getenv ("GST_VALIDATE_SCENARIOS_PATH");
|
||||||
|
if (envvar)
|
||||||
|
env_scenariodir = g_strsplit (envvar, ":", 0);
|
||||||
|
|
||||||
kf = g_key_file_new ();
|
kf = g_key_file_new ();
|
||||||
_list_scenarios_in_dir (dir, kf);
|
_list_scenarios_in_dir (dir, kf);
|
||||||
g_object_unref (dir);
|
g_object_unref (dir);
|
||||||
|
|
Loading…
Reference in a new issue