From 889b685f181ef6738340e4e8252f19b048a91d68 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 22 Oct 2003 06:50:08 +0000 Subject: [PATCH] fix alsa errors being duplicated to stderr --- stepmania/src/arch/Sound/ALSA9Helpers.cpp | 8 +++++++- stepmania/src/arch/Sound/ALSA9Helpers.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stepmania/src/arch/Sound/ALSA9Helpers.cpp b/stepmania/src/arch/Sound/ALSA9Helpers.cpp index 4eeea2b427..c40e166fcc 100644 --- a/stepmania/src/arch/Sound/ALSA9Helpers.cpp +++ b/stepmania/src/arch/Sound/ALSA9Helpers.cpp @@ -68,7 +68,6 @@ void Alsa9Buf::GetSoundCardDebugInfo() return; done = true; - int card = -1; while( snd_card_next( &card ) >= 0 && card >= 0 ) { @@ -123,10 +122,17 @@ void Alsa9Buf::GetSoundCardDebugInfo() LOG->Info( "No ALSA sound cards were found."); } +void Alsa9Buf::ErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...) +{ +/* NOP */ +} + Alsa9Buf::Alsa9Buf( hw hardware, int channels_, int samplerate_ ) { GetSoundCardDebugInfo(); + snd_lib_error_set_handler( ErrorHandler ); + channels = channels_; samplerate = samplerate_; samplebits = 16; diff --git a/stepmania/src/arch/Sound/ALSA9Helpers.h b/stepmania/src/arch/Sound/ALSA9Helpers.h index 3607e68e65..4f1e721d16 100644 --- a/stepmania/src/arch/Sound/ALSA9Helpers.h +++ b/stepmania/src/arch/Sound/ALSA9Helpers.h @@ -20,6 +20,8 @@ private: bool Recover( int r ); bool SetHWParams(); + static void ErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...); + public: static void GetSoundCardDebugInfo();