ext/alsa/gstalsa.c: Don't send ALSA debugging to stderr.
authorBenjamin Otte <otte@gnome.org>
Sat, 27 Dec 2003 17:19:29 +0000 (17:19 +0000)
committerBenjamin Otte <otte@gnome.org>
Sat, 27 Dec 2003 17:19:29 +0000 (17:19 +0000)
Original commit message from CVS:
2003-12-27  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* ext/alsa/gstalsa.c: (gst_alsa_open_audio):
Don't send ALSA debugging to stderr.
* ext/alsa/gstalsa.h:
Use GST_WARNING instead of g_warning when ALSA functions fail.

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

index d26b00b..c7f2220 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2003-12-27  Benjamin Otte  <in7y118@public.uni-hamburg.de>
 
+       * ext/alsa/gstalsa.c: (gst_alsa_open_audio):
+         Don't send ALSA debugging to stderr.
+       * ext/alsa/gstalsa.h:
+         Use GST_WARNING instead of g_warning when ALSA functions fail.
+
+2003-12-27  Benjamin Otte  <in7y118@public.uni-hamburg.de>
+
        * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support):
          Free XVAdapterInfo correctly.
 
index bb8537d..6c092f8 100644 (file)
@@ -892,8 +892,11 @@ gst_alsa_open_audio (GstAlsa *this)
 
   GST_INFO ( "Opening alsa device \"%s\"...\n", this->device);
 
+#if 0
+  /* enable this to get better debugging */
   ERROR_CHECK (snd_output_stdio_attach (&this->out, stderr, 0),
                "error opening log output: %s");
+#endif
   /* we use non-blocking i/o */
   ERROR_CHECK (snd_pcm_open (&this->handle, this->device, 
                              GST_ALSA_GET_CLASS (this)->stream, SND_PCM_NONBLOCK),
index ce6e7fb..7823bcb 100644 (file)
@@ -34,6 +34,8 @@ GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
 
 
 /* error checking for standard alsa functions */
+/* 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; } \
 }G_STMT_END
@@ -43,7 +45,7 @@ GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
 #define ERROR_CHECK(value, ...) G_STMT_START{ \
   int err = (value); \
   if (err < 0) { \
-    g_warning ( __VA_ARGS__, snd_strerror (err)); \
+    GST_WARNING_OBJECT (this, __VA_ARGS__, snd_strerror (err)); \
     return FALSE; \
   } \
 }G_STMT_END
@@ -52,7 +54,7 @@ GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
 #define ERROR_CHECK(value, args...) G_STMT_START{ \
   int err = (value); \
   if (err < 0) { \
-    g_warning ( ## args, snd_strerror (err)); \
+    GST_WARNING_OBJECT (this, ## args, snd_strerror (err)); \
     return FALSE; \
   } \
 }G_STMT_END
@@ -61,7 +63,7 @@ GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
 #define ERROR_CHECK(value, args...) G_STMT_START{ \
   int err = (value); \
   if (err < 0) { \
-    g_warning (snd_strerror (err)); \
+    GST_WARNING_OBJECT (this, snd_strerror (err)); \
     return FALSE; \
   } \
 }G_STMT_END