From 558a8a90f3d88aa73024ebe41c24f0de70c55d43 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 23 Sep 2007 10:16:49 +0000 Subject: [PATCH] plugins/elements/gstfakesink.c: Add some debug text to error message to indicate that we errored out on request. Original commit message from CVS: * plugins/elements/gstfakesink.c: Add some debug text to error message to indicate that we errored out on request. * tools/gst-launch.c: When the state change to PLAYING fails, check for an error message on the bus and print it. --- ChangeLog | 10 ++++++++++ plugins/elements/gstfakesink.c | 3 ++- tools/gst-launch.c | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2813f00..2ad6d0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-09-23 Tim-Philipp Müller + + * plugins/elements/gstfakesink.c: + Add some debug text to error message to indicate that + we errored out on request. + + * tools/gst-launch.c: + When the state change to PLAYING fails, check for an + error message on the bus and print it. + 2007-09-22 Thomas Vander Stichele translated by: Jorge González González diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c index 2141ac4..aef4deb 100644 --- a/plugins/elements/gstfakesink.c +++ b/plugins/elements/gstfakesink.c @@ -490,6 +490,7 @@ gst_fake_sink_change_state (GstElement * element, GstStateChange transition) /* ERROR */ error: - GST_ELEMENT_ERROR (element, CORE, STATE_CHANGE, (NULL), (NULL)); + GST_ELEMENT_ERROR (element, CORE, STATE_CHANGE, (NULL), + ("Erroring out on state change as requested")); return GST_STATE_CHANGE_FAILURE; } diff --git a/tools/gst-launch.c b/tools/gst-launch.c index c73f764..56c9b13 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -731,7 +731,22 @@ main (int argc, char *argv[]) fprintf (stderr, _("Setting pipeline to PLAYING ...\n")); if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { + GstMessage *err_msg; + GstBus *bus; + fprintf (stderr, _("ERROR: pipeline doesn't want to play.\n")); + bus = gst_element_get_bus (pipeline); + if ((err_msg = gst_bus_poll (bus, GST_MESSAGE_ERROR, 0))) { + GError *gerror; + gchar *debug; + + gst_message_parse_error (err_msg, &gerror, &debug); + gst_object_default_error (GST_MESSAGE_SRC (err_msg), gerror, debug); + gst_message_unref (err_msg); + g_error_free (gerror); + g_free (debug); + } + gst_object_unref (bus); res = -1; goto end; } -- 2.7.4