From 0f6cf419470b7533666b8f2a3a2562c168b161e1 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 10 Mar 2010 14:34:57 +0100 Subject: [PATCH] playsink: provide correct error message if configured audio/video sink fails --- gst/playback/gstplaysink.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index d25223ed86..13528c832e 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1088,7 +1088,7 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async, /* ERRORS */ no_sinks: { - if (!elem) { + if (!elem && !playsink->video_sink) { post_missing_element_message (playsink, "autovideosink"); if (strcmp (DEFAULT_VIDEOSINK, "autovideosink")) { post_missing_element_message (playsink, DEFAULT_VIDEOSINK); @@ -1100,7 +1100,11 @@ no_sinks: (_("The autovideosink element is missing.")), (NULL)); } } else { - if (strcmp (DEFAULT_VIDEOSINK, "autovideosink")) { + if (playsink->video_sink) { + GST_ELEMENT_ERROR (playsink, CORE, STATE_CHANGE, + (_("Configured videosink %s is not working."), + GST_ELEMENT_NAME (playsink->video_sink)), (NULL)); + } else if (strcmp (DEFAULT_VIDEOSINK, "autovideosink")) { GST_ELEMENT_ERROR (playsink, CORE, STATE_CHANGE, (_("Both autovideosink and %s elements are not working."), DEFAULT_VIDEOSINK), (NULL)); @@ -1563,7 +1567,7 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw, gboolean queue) /* ERRORS */ no_sinks: { - if (!elem) { + if (!elem && !playsink->audio_sink) { post_missing_element_message (playsink, "autoaudiosink"); if (strcmp (DEFAULT_AUDIOSINK, "autoaudiosink")) { post_missing_element_message (playsink, DEFAULT_AUDIOSINK); @@ -1575,7 +1579,11 @@ no_sinks: (_("The autoaudiosink element is missing.")), (NULL)); } } else { - if (strcmp (DEFAULT_AUDIOSINK, "autoaudiosink")) { + if (playsink->audio_sink) { + GST_ELEMENT_ERROR (playsink, CORE, STATE_CHANGE, + (_("Configured audiosink %s is not working."), + GST_ELEMENT_NAME (playsink->audio_sink)), (NULL)); + } else if (strcmp (DEFAULT_AUDIOSINK, "autoaudiosink")) { GST_ELEMENT_ERROR (playsink, CORE, STATE_CHANGE, (_("Both autoaudiosink and %s elements are not working."), DEFAULT_AUDIOSINK), (NULL));