summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2007-01-19 19:09:05 +0000
committerTim-Philipp Müller <tim@centricular.net>2007-01-19 19:09:05 +0000
commitacf3bcdfbb92cbc2628c2cd76e4b0dd70e4ad599 (patch)
treea8dbf0f7834c50147fc7ff785829e09a4653a251 /gst
parent638dbd7b712ffbf9833a8959643cbfa1fec87431 (diff)
downloadgstreamer-plugins-base-acf3bcdfbb92cbc2628c2cd76e4b0dd70e4ad599.tar.gz
gst/playback/gstplaybasebin.c: Attempt at a better error message in case we don't have the required
Original commit message from CVS: * gst/playback/gstplaybasebin.c: (setup_subtitle), (gen_source_element), (gst_play_base_bin_change_state): Attempt at a better error message in case we don't have the required URI handler installed; post missing-plugin message also when we're missing an URI handler for the subtitle URI; clean up properly also when an error occurs and we never made it to PAUSED state. * tests/check/elements/playbin.c: (GST_START_TEST), (playbin_suite): Check that we're also getting a missing-plugin messsage for a missing subtitle URI handler (and clean up properly).
Diffstat (limited to 'gst')
-rw-r--r--gst/playback/gstplaybasebin.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c
index 4d814f060..504a9d4d1 100644
--- a/gst/playback/gstplaybasebin.c
+++ b/gst/playback/gstplaybasebin.c
@@ -1443,8 +1443,17 @@ unknown_uri:
gchar *prot = gst_uri_get_protocol (sub_uri);
if (prot) {
+ gchar *desc;
+
+ gst_element_post_message (GST_ELEMENT (play_base_bin),
+ gst_missing_uri_source_message_new (GST_ELEMENT (play_base_bin),
+ prot));
+
+ desc = gst_base_utils_get_source_description (prot);
GST_ELEMENT_ERROR (play_base_bin, CORE, MISSING_PLUGIN,
- (_("No URI handler implemented for \"%s\"."), prot), (NULL));
+ (_("A %s plugin is required to play this stream, but not installed."),
+ desc), ("No URI handler to handle sub_uri: %s", sub_uri));
+ g_free (desc);
g_free (prot);
} else
goto invalid_uri;
@@ -1560,14 +1569,17 @@ no_source:
/* whoops, could not create the source element, dig a little deeper to
* figure out what might be wrong. */
if (prot) {
- GstElement *this = GST_ELEMENT_CAST (play_base_bin);
- GstMessage *msg;
+ gchar *desc;
- msg = gst_missing_uri_source_message_new (this, prot);
- gst_element_post_message (this, msg);
+ gst_element_post_message (GST_ELEMENT (play_base_bin),
+ gst_missing_uri_source_message_new (GST_ELEMENT (play_base_bin),
+ prot));
+ desc = gst_base_utils_get_source_description (prot);
GST_ELEMENT_ERROR (play_base_bin, CORE, MISSING_PLUGIN,
- (_("No URI handler implemented for \"%s\"."), prot), (NULL));
+ (_("A %s plugin is required to play this stream, but not installed."),
+ desc), ("No URI handler for %s", prot));
+ g_free (desc);
g_free (prot);
} else
goto invalid_uri;
@@ -2552,7 +2564,9 @@ gst_play_base_bin_change_state (GstElement * element, GstStateChange transition)
finish_source (play_base_bin);
break;
+ /* clean-up in both cases, READY=>NULL clean-up is if there was an error */
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ case GST_STATE_CHANGE_READY_TO_NULL:
play_base_bin->need_rebuild = TRUE;
remove_decoders (play_base_bin);
remove_groups (play_base_bin);