[vlc-commits] [Git][videolan/vlc][master] 4 commits: test/clock: set back the correct test duration

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 16 17:16:11 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
23c38df8 by Thomas Guillem at 2023-11-16T16:54:36+00:00
test/clock: set back the correct test duration

Regression from 77cd3505e4df84aa3e21fab90961f61c90da54ba

- - - - -
9e2a9c21 by Thomas Guillem at 2023-11-16T16:54:36+00:00
test/clock: don't send argv[0] to libvlc

libvlc was trying to preparse the clock scenario

- - - - -
1a356169 by Thomas Guillem at 2023-11-16T16:54:36+00:00
test/clock: add a way to force a scenario duration from cmdline

Because 24h or 2h or points can take a lot of time to process by the
external tracer-gui tool.

- - - - -
55803d57 by Thomas Guillem at 2023-11-16T16:54:36+00:00
test/clock: remove DRIFT_SCENARIO macro

Scenarios are easier to read that way.

- - - - -


1 changed file:

- test/src/clock/clock.c


Changes:

=====================================
test/src/clock/clock.c
=====================================
@@ -376,25 +376,32 @@ static void play_scenario(libvlc_int_t *vlc, struct vlc_tracer *tracer,
     vlc_clock_main_Delete(mainclk);
 }
 
-static void run_scenarios(int main_argc, const char *main_argv[],
+static void run_scenarios(int argc, const char *argv[],
                           struct clock_scenario *scenarios, size_t count)
 {
-
-    int argc;
-    const char * const *argv;
+    /* Skip argv[0] */
+    argc--;
+    argv++;
 
     const char *scenario_name = NULL;
-    if (main_argc > 1)
+    vlc_tick_t forced_duration = VLC_TICK_INVALID;
+    if (argc > 0)
     {
         /* specific test run from the user with custom options */
-        scenario_name = main_argv[1];
-        argc = main_argc - 1;
-        argv = &main_argv[1];
-    }
-    else
-    {
-        argc = main_argc;
-        argv = main_argv;
+        scenario_name = argv[0];
+        argc--;
+        argv++;
+
+        if (argc > 0)
+        {
+            long long val = atoll(argv[0]);
+            if (val > 0)
+            {
+                forced_duration = val;
+                argc--;
+                argv++;
+            }
+        }
     }
 
     libvlc_instance_t *vlc = libvlc_new(argc, argv);
@@ -410,7 +417,12 @@ static void run_scenarios(int main_argc, const char *main_argv[],
     {
         if (scenario_name == NULL
          || strcmp(scenario_name, scenarios[i].name) == 0)
-            play_scenario(vlc->p_libvlc_int, tracer, &scenarios[i]);
+        {
+            struct clock_scenario *scenario = &scenarios[i];
+            if (forced_duration != VLC_TICK_INVALID)
+                scenario->duration = forced_duration;
+            play_scenario(vlc->p_libvlc_int, tracer, scenario);
+        }
     }
 
     vlc_tracer_Destroy(tracer);
@@ -610,14 +622,6 @@ static void drift_sudden_update(const struct clock_ctx *ctx, size_t index,
     .stream_increment = increment_, \
     .video_fps = video_fps_
 
-#define DRIFT_SCENARIO(name_, desc_, duration_, increment_, video_fps_, drift_) \
-    .name = name_, \
-    .desc = desc_, \
-    INIT_SYSTEM_STREAM_TIMING(duration_, increment_, video_fps_), \
-    .total_drift_duration = drift_, \
-    .update = drift_update, \
-    .check = drift_check,
-
 static struct clock_scenario clock_scenarios[] = {
 {
     .name = "normal",
@@ -629,49 +633,42 @@ static struct clock_scenario clock_scenarios[] = {
 {
     .name = "lowprecision",
     .desc = "low precision update has a coeff near 1.0f",
-    INIT_SYSTEM_STREAM_TIMING(VLC_TICK_FROM_SEC(240), DEFAULT_STREAM_INCREMENT, 60),
+    INIT_SYSTEM_STREAM_TIMING(VLC_TICK_2H, DEFAULT_STREAM_INCREMENT, 60),
     .coeff_epsilon = 0.005,
     .update = lowprecision_update,
     .check = lowprecision_check,
 },
 {
-    DRIFT_SCENARIO(
-        "drift_72",
-        "a drift of 72ms in 2h is handled",
-        VLC_TICK_2H,
-        DEFAULT_STREAM_INCREMENT,
-        60,
-        VLC_TICK_FROM_MS(72)
-)},
+    .name = "drift_72",
+    .desc = "a drift of 72ms in 2h is handled",
+    INIT_SYSTEM_STREAM_TIMING(VLC_TICK_2H, DEFAULT_STREAM_INCREMENT, 60),
+    .total_drift_duration = VLC_TICK_FROM_MS(72),
+    .update = drift_update,
+    .check = drift_check,
+},
 {
-    DRIFT_SCENARIO(
-        "drift_-72",
-        "a drift of -72ms in 2h is handled",
-        VLC_TICK_2H,
-        DEFAULT_STREAM_INCREMENT,
-        60,
-        -VLC_TICK_FROM_MS(72)
-    )
+    .name = "drift_-72",
+    .desc = "a drift of -72ms in 2h is handled",
+    INIT_SYSTEM_STREAM_TIMING(VLC_TICK_2H, DEFAULT_STREAM_INCREMENT, 60),
+    .total_drift_duration = -VLC_TICK_FROM_MS(72),
+    .update = drift_update,
+    .check = drift_check,
 },
 {
-    DRIFT_SCENARIO(
-        "drift_864",
-        "a drift of 864ms in 24h is handled",
-        VLC_TICK_24H,
-        DEFAULT_STREAM_INCREMENT,
-        0, /* too long to test video */
-        VLC_TICK_FROM_MS(864)
-    )
+    .name = "drift_864",
+    .desc = "a drift of 864ms in 24h is handled",
+    INIT_SYSTEM_STREAM_TIMING(VLC_TICK_24H, DEFAULT_STREAM_INCREMENT, 0),
+    .total_drift_duration = VLC_TICK_FROM_MS(864),
+    .update = drift_update,
+    .check = drift_check,
 },
 {
-    DRIFT_SCENARIO(
-        "drift_-864",
-        "a drift of -864ms in 24h is handled",
-        VLC_TICK_24H,
-        DEFAULT_STREAM_INCREMENT,
-        0, /* too long to test video */
-        -VLC_TICK_FROM_MS(864)
-    )
+    .name = "drift_-864",
+    .desc = "a drift of -864ms in 24h is handled",
+    INIT_SYSTEM_STREAM_TIMING(VLC_TICK_24H, DEFAULT_STREAM_INCREMENT, 0),
+    .total_drift_duration = -VLC_TICK_FROM_MS(864),
+    .update = drift_update,
+    .check = drift_check,
 },
 {
     .name = "drift_sudden",



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e51246cb67ca33731fb7defacfca4254dfa0c6e6...55803d57ca9025bc8c8575972857218ef78681d0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e51246cb67ca33731fb7defacfca4254dfa0c6e6...55803d57ca9025bc8c8575972857218ef78681d0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list