summaryrefslogtreecommitdiffstats
path: root/tests/check
diff options
context:
space:
mode:
Diffstat (limited to 'tests/check')
-rw-r--r--tests/check/pipelines/metadata.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/check/pipelines/metadata.c b/tests/check/pipelines/metadata.c
index 9f5034e3..ef1bdbc5 100644
--- a/tests/check/pipelines/metadata.c
+++ b/tests/check/pipelines/metadata.c
@@ -38,7 +38,6 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data)
gst_message_parse_error (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
- gst_message_unref (message);
g_error_free (gerror);
g_free (debug);
g_main_loop_quit (loop);
@@ -81,12 +80,18 @@ test_tags (const gchar * tag_str)
gint i, j, n_recv, n_sent;
const gchar *name_sent, *name_recv;
const GValue *value_sent, *value_recv;
- gboolean found;
+ gboolean found, ok;
gint comparison;
-
GstElement *videotestsrc, *jpegenc, *metadatamux, *metadatademux, *fakesink;
GstTagSetter *setter;
+ GST_DEBUG ("testing tags : %s", tag_str);
+
+ if (received_tags) {
+ gst_tag_list_free (received_tags);
+ received_tags = NULL;
+ }
+
pipeline = gst_pipeline_new ("pipeline");
fail_unless (pipeline != NULL);
@@ -94,7 +99,7 @@ test_tags (const gchar * tag_str)
fail_unless (videotestsrc != NULL);
g_object_set (G_OBJECT (videotestsrc), "num-buffers", 1, NULL);
- jpegenc = gst_element_factory_make ("jpegenc", "enc");
+ jpegenc = gst_element_factory_make ("q", "enc");
if (jpegenc == NULL) {
g_print ("Cannot test - jpegenc not available\n");
return;
@@ -113,8 +118,9 @@ test_tags (const gchar * tag_str)
gst_bin_add_many (GST_BIN (pipeline), videotestsrc, jpegenc, metadatamux,
metadatademux, fakesink, NULL);
- fail_unless (gst_element_link_many (videotestsrc, jpegenc, metadatamux,
- metadatademux, fakesink, NULL));
+ ok = gst_element_link_many (videotestsrc, jpegenc, metadatamux, metadatademux,
+ fakesink, NULL);
+ fail_unless (ok == TRUE);
loop = g_main_loop_new (NULL, TRUE);
fail_unless (loop != NULL);
@@ -129,11 +135,14 @@ test_tags (const gchar * tag_str)
setter = GST_TAG_SETTER (metadatamux);
fail_unless (setter != NULL);
sent_tags = gst_structure_from_string (tag_str, NULL);
+ fail_unless (sent_tags != NULL);
gst_tag_setter_merge_tags (setter, sent_tags, GST_TAG_MERGE_REPLACE);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_main_loop_run (loop);
+ GST_DEBUG ("mainloop done : %p", received_tags);
+
/* verify tags */
fail_unless (received_tags != NULL);
n_recv = gst_structure_n_fields (received_tags);