From 0f692e202ed346904f78d601c9e47957041619c6 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 25 Jul 2016 10:30:26 +0200 Subject: player: move 'position-update-interval' setting to the config struct https://bugzilla.gnome.org/show_bug.cgi?id=769144 --- tests/check/libs/player.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/check/libs/player.c b/tests/check/libs/player.c index e0fcf9266..e4c83fc70 100644 --- a/tests/check/libs/player.c +++ b/tests/check/libs/player.c @@ -100,20 +100,17 @@ START_TEST (test_set_and_get_position_update_interval) { GstPlayer *player; guint interval = 0; + GstStructure *config; player = gst_player_new (NULL, NULL); fail_unless (player != NULL); - gst_player_set_position_update_interval (player, 500); - interval = gst_player_get_position_update_interval (player); - + config = gst_player_get_config (player); + gst_player_config_set_position_update_interval (config, 500); + interval = gst_player_config_get_position_update_interval (config); fail_unless (interval == 500); - - g_object_set (player, "position-update-interval", 1000, NULL); - g_object_get (player, "position-update-interval", &interval, NULL); - - fail_unless_equals_int (interval, 1000); + gst_player_set_config (player, config); g_object_unref (player); } @@ -1476,7 +1473,6 @@ test_play_position_update_interval_cb (GstPlayer * player, if (do_quit && position >= 2000 * GST_MSECOND) { do_quit = FALSE; - gst_player_set_position_update_interval (player, 0); g_main_loop_quit (new_state->loop); } } else if (change == STATE_CHANGE_END_OF_STREAM || @@ -1499,6 +1495,7 @@ START_TEST (test_play_position_update_interval) GstPlayer *player; TestPlayerState state; gchar *uri; + GstStructure *config; memset (&state, 0, sizeof (state)); state.loop = g_main_loop_new (NULL, FALSE); @@ -1506,7 +1503,10 @@ START_TEST (test_play_position_update_interval) state.test_data = GINT_TO_POINTER (0); player = test_player_new (&state); - gst_player_set_position_update_interval (player, 600); + + config = gst_player_get_config (player); + gst_player_config_set_position_update_interval (config, 600); + gst_player_set_config (player, config); fail_unless (player != NULL); @@ -1520,6 +1520,13 @@ START_TEST (test_play_position_update_interval) fail_unless_equals_int (GPOINTER_TO_INT (state.test_data), 5); + /* Disable position updates */ + gst_player_stop (player); + + config = gst_player_get_config (player); + gst_player_config_set_position_update_interval (config, 0); + gst_player_set_config (player, config); + g_timeout_add (2000, quit_loop_cb, state.loop); g_main_loop_run (state.loop); -- cgit v1.2.3