diff --git a/ChangeLog b/ChangeLog index d26b00bc35..c7f222031a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +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): diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index bb8537dcf1..6c092f8a6f 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 ce6e7fbd94..7823bcb9b1 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