[vlc-commits] test: player: test a playback without any outputs

Thomas Guillem git at videolan.org
Fri May 10 14:36:37 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 10 10:33:19 2019 +0200| [9cd2ec292474f2f1ed8ce013907e4ad5fd1d909c] | committer: Thomas Guillem

test: player: test a playback without any outputs

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9cd2ec292474f2f1ed8ce013907e4ad5fd1d909c
---

 test/src/input/player.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/test/src/input/player.c b/test/src/input/player.c
index b70542403a..91b2bdd474 100644
--- a/test/src/input/player.c
+++ b/test/src/input/player.c
@@ -1691,8 +1691,31 @@ test_delete_while_playback(vlc_object_t *obj, bool start)
 }
 
 static void
+test_no_outputs(struct ctx *ctx)
+{
+    test_log("test_no_outputs\n");
+    vlc_player_t *player = ctx->player;
+
+    struct media_params params = DEFAULT_MEDIA_PARAMS(VLC_TICK_FROM_MS(10));
+    player_set_current_mock_media(ctx, "media1", &params, false);
+    player_start(ctx);
+
+    wait_state(ctx, VLC_PLAYER_STATE_STOPPING);
+    {
+        vec_on_vout_changed *vec = &ctx->report.on_vout_changed;
+        assert(vec->size == 0);
+    }
+
+    audio_output_t *aout = vlc_player_aout_Hold(player);
+    assert(!aout);
+
+    test_end(ctx);
+}
+
+static void
 test_outputs(struct ctx *ctx)
 {
+    test_log("test_outputs\n");
     vlc_player_t *player = ctx->player;
 
     /* Test that the player has a valid aout and vout, even before first
@@ -1809,6 +1832,11 @@ main(void)
 
     struct ctx ctx;
 
+    /* Test with --aout=none --vout=none */
+    ctx_init(&ctx, false);
+    test_no_outputs(&ctx);
+    ctx_destroy(&ctx);
+
     ctx_init(&ctx, true);
 
     test_outputs(&ctx); /* Must be the first test */



More information about the vlc-commits mailing list