From 98b38b04c9f771562cdf262c6fa49734a318f5ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Nov 2019 14:29:58 +0100 Subject: player: do not require dummy file arguments to use --unittest Move the test execution above the point where it checks for an empty playlist and exits if that's the case. --- player/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/player/main.c b/player/main.c index 1c8c8014b1..d2fb22668f 100644 --- a/player/main.c +++ b/player/main.c @@ -396,6 +396,11 @@ int mp_initialize(struct MPContext *mpctx, char **options) return -1; } +#if HAVE_TESTS + if (opts->test_mode && opts->test_mode[0]) + return run_tests(mpctx) ? 1 : -1; +#endif + if (!mpctx->playlist->first && !opts->player_idle_mode) { // nothing to play mp_print_version(mpctx->log, true); @@ -430,11 +435,6 @@ int mp_initialize(struct MPContext *mpctx, char **options) if (opts->force_vo == 2 && handle_force_window(mpctx, false) < 0) return -1; -#if HAVE_TESTS - if (opts->test_mode && opts->test_mode[0]) - return run_tests(mpctx) ? 1 : -1; -#endif - MP_STATS(mpctx, "end init"); return 0; -- cgit v1.2.3