From 2c9d442d51dd681463ae090c3c57320a90a4f888 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 7 Nov 2011 17:25:45 +0000 Subject: [PATCH] tests: fix audiocdsrc for changed preroll behaviour Previously, the source posted a TAG message before buffers would even be pushed towards the sink, so we'd get the TAG message before any ASYNC_DONE message. Now the tags get sent downstream to the sink to get posted there, and the tag event will get queued and handled later after preroll has finished, so now we get the ASYNC_DONE message before the TAG message. --- tests/check/libs/audiocdsrc.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/check/libs/audiocdsrc.c b/tests/check/libs/audiocdsrc.c index 1f2e58b..534c427 100644 --- a/tests/check/libs/audiocdsrc.c +++ b/tests/check/libs/audiocdsrc.c @@ -329,10 +329,21 @@ GST_START_TEST (test_discid_calculations) GST_CD_FOO_SRC (foosrc)->cur_disc = i; gst_element_set_state (pipeline, GST_STATE_PLAYING); + /* TAG messages are queued and only rendered after the preroll object has + * been prerolled (and ASYNC_DONE was posted), the TAG event got queued for + * processing/posting after that */ + GST_LOG ("waiting for ASYNC_DONE message on the bus"); + msg = + gst_bus_timed_pop_filtered (GST_ELEMENT_BUS (pipeline), + GST_CLOCK_TIME_NONE, GST_MESSAGE_ASYNC_DONE); + gst_message_unref (msg); + + GST_LOG ("waiting for TAG message on the bus"); msg = gst_bus_timed_pop_filtered (GST_ELEMENT_BUS (pipeline), GST_CLOCK_TIME_NONE, GST_MESSAGE_TAG); gst_message_parse_tag (msg, &tags); + GST_LOG ("got tags: %" GST_PTR_FORMAT, tags); fail_unless (tags != NULL); fail_unless (tag_list_has_tag (tags, "track-count", G_TYPE_UINT)); fail_unless (tag_list_has_tag (tags, "track-number", G_TYPE_UINT)); @@ -345,11 +356,6 @@ GST_START_TEST (test_discid_calculations) gst_tag_list_free (tags); gst_message_unref (msg); - msg = - gst_bus_timed_pop_filtered (GST_ELEMENT_BUS (pipeline), - GST_CLOCK_TIME_NONE, GST_MESSAGE_ASYNC_DONE); - gst_message_unref (msg); - gst_element_set_state (pipeline, GST_STATE_NULL); } -- 2.7.4