gst/playback/gstplaybin.c (gen_audio_element): Use autoaudiosink as well if it is...
authorAndy Wingo <wingo@pobox.com>
Mon, 14 Nov 2005 17:44:40 +0000 (17:44 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 14 Nov 2005 17:44:40 +0000 (17:44 +0000)
Original commit message from CVS:
2005-11-14  Andy Wingo  <wingo@pobox.com>

* gst/playback/gstplaybin.c (gen_audio_element): Use autoaudiosink
as well if it is available. Fixes #316442.

ChangeLog
gst/playback/gstplaybin.c

index 499bf0a..f771cfb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-14  Andy Wingo  <wingo@pobox.com>
+
+       * gst/playback/gstplaybin.c (gen_audio_element): Use autoaudiosink
+       as well if it is available. Fixes #316442.
+
 2005-11-14  Michael Smith <msmith@fluendo.com>
 
        * ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), (gst_ogg_mux_init),
index 1a06327..b924b0a 100644 (file)
@@ -532,6 +532,17 @@ gen_audio_element (GstPlayBin * play_bin)
   if (play_bin->audio_sink) {
     sink = play_bin->audio_sink;
   } else {
+    sink = gst_element_factory_make ("autoaudiiosink", "audiosink");
+    if (sink == NULL) {
+      sink = gst_element_factory_make ("alsasink", "audiosink");
+    }
+    /* FIXME: this warrants adding a CORE error category for missing
+     * elements/plugins */
+    if (sink == NULL) {
+      GST_ELEMENT_ERROR (play_bin, CORE, FAILED,
+          (_("Both autoaudiosink and alsasink elements are missing.")), (NULL));
+      return NULL;
+    }
     sink = gst_element_factory_make ("alsasink", "audiosink");
     if (sink == NULL) {
       g_warning ("could not create autoaudiosink element");