ext/alsa/gstalsa.*: debugging output fixes
authorBenjamin Otte <otte@gnome.org>
Wed, 24 Mar 2004 18:48:55 +0000 (18:48 +0000)
committerBenjamin Otte <otte@gnome.org>
Wed, 24 Mar 2004 18:48:55 +0000 (18:48 +0000)
Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_probe_hw_params):
* ext/alsa/gstalsa.h:
debugging output fixes

ChangeLog
ext/alsa/gstalsa.c
ext/alsa/gstalsa.h

index f26718a..b122cb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-03-24  Benjamin Otte  <otte@gnome.org>
 
+       * ext/alsa/gstalsa.c: (gst_alsa_open_audio),
+       (gst_alsa_probe_hw_params):
+       * ext/alsa/gstalsa.h:
+         debugging output fixes
+
+2004-03-24  Benjamin Otte  <otte@gnome.org>
+
        * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_set_property):
          don't g_return_if_fail if element is PLAYING, fail silently as every
          other element.
index f4e75e5..88b170f 100644 (file)
@@ -1114,7 +1114,7 @@ gst_alsa_open_audio (GstAlsa * this)
   if (!gst_element_get_pad_list (GST_ELEMENT (this)))
     return TRUE;
 
-  GST_INFO ("Opening alsa device \"%s\"...\n", this->device);
+  GST_INFO ("Opening alsa device \"%s\"...", this->device);
 
 #if 0
   /* enable this to get better debugging */
@@ -1151,7 +1151,7 @@ gst_alsa_probe_hw_params (GstAlsa * this, GstAlsaFormat * format)
   g_return_val_if_fail (this != NULL, FALSE);
   g_return_val_if_fail (format != NULL, FALSE);
 
-  GST_INFO ("Probing format: %s %dHz, %d channels\n",
+  GST_INFO ("Probing format: %s %dHz, %d channels",
       snd_pcm_format_name (format->format), format->rate, format->channels);
 
   snd_pcm_hw_params_alloca (&hw_params);
@@ -1159,8 +1159,10 @@ gst_alsa_probe_hw_params (GstAlsa * this, GstAlsaFormat * format)
   SIMPLE_ERROR_CHECK (snd_pcm_hw_params_set_periods_integer (this->handle,
           hw_params));
 
+#if 0
   /* enable this for soundcard specific debugging */
-  /* snd_pcm_hw_params_dump (hw_params, this->out); */
+  snd_pcm_hw_params_dump (hw_params, this->out);
+#endif
 
   mask = alloca (snd_pcm_access_mask_sizeof ());
   snd_pcm_access_mask_none (mask);
index 9b9c9d1..b0cb95b 100644 (file)
@@ -37,7 +37,11 @@ GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
 /* NOTE: these functions require a GObject *this and can only be used in 
    functions that return TRUE on success and FALSE on error */
 #define SIMPLE_ERROR_CHECK(value) G_STMT_START{ \
-  int err = (value); if (err < 0) { return FALSE; } \
+  int err = (value); \
+  if (err < 0) { \
+    GST_WARNING_OBJECT (this, "\"" #value "\": %s", snd_strerror (err)); \
+    return FALSE; \
+  } \
 }G_STMT_END