From: Benjamin Otte Date: Sat, 27 Dec 2003 17:19:29 +0000 (+0000) Subject: ext/alsa/gstalsa.c: Don't send ALSA debugging to stderr. X-Git-Tag: 1.19.3~511^2~14946 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=977bb1105e09d7377d27b57eada74b26bc33c7d2;p=platform%2Fupstream%2Fgstreamer.git ext/alsa/gstalsa.c: Don't send ALSA debugging to stderr. Original commit message from CVS: 2003-12-27 Benjamin Otte * 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. --- diff --git a/ChangeLog b/ChangeLog index d26b00b..c7f2220 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-12-27 Benjamin Otte + * 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 + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support): Free XVAdapterInfo correctly. diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index bb8537d..6c092f8 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -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), diff --git a/ext/alsa/gstalsa.h b/ext/alsa/gstalsa.h index ce6e7fb..7823bcb 100644 --- a/ext/alsa/gstalsa.h +++ b/ext/alsa/gstalsa.h @@ -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