fix alsa errors being duplicated to stderr
This commit is contained in:
@@ -68,7 +68,6 @@ void Alsa9Buf::GetSoundCardDebugInfo()
|
|||||||
return;
|
return;
|
||||||
done = true;
|
done = true;
|
||||||
|
|
||||||
|
|
||||||
int card = -1;
|
int card = -1;
|
||||||
while( snd_card_next( &card ) >= 0 && card >= 0 )
|
while( snd_card_next( &card ) >= 0 && card >= 0 )
|
||||||
{
|
{
|
||||||
@@ -123,10 +122,17 @@ void Alsa9Buf::GetSoundCardDebugInfo()
|
|||||||
LOG->Info( "No ALSA sound cards were found.");
|
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_ )
|
Alsa9Buf::Alsa9Buf( hw hardware, int channels_, int samplerate_ )
|
||||||
{
|
{
|
||||||
GetSoundCardDebugInfo();
|
GetSoundCardDebugInfo();
|
||||||
|
|
||||||
|
snd_lib_error_set_handler( ErrorHandler );
|
||||||
|
|
||||||
channels = channels_;
|
channels = channels_;
|
||||||
samplerate = samplerate_;
|
samplerate = samplerate_;
|
||||||
samplebits = 16;
|
samplebits = 16;
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ private:
|
|||||||
bool Recover( int r );
|
bool Recover( int r );
|
||||||
bool SetHWParams();
|
bool SetHWParams();
|
||||||
|
|
||||||
|
static void ErrorHandler(const char *file, int line, const char *function, int err, const char *fmt, ...);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void GetSoundCardDebugInfo();
|
static void GetSoundCardDebugInfo();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user