use HAVE_OSS_GETVERSION
don't print "version 0.0.0" if ioctl(OSS_GETVERSION) fails
This commit is contained in:
@@ -103,12 +103,16 @@ int64_t RageSound_OSS::GetPosition(const RageSoundBase *snd) const
|
||||
|
||||
void RageSound_OSS::CheckOSSVersion( int fd )
|
||||
{
|
||||
int version;
|
||||
int version = 0;
|
||||
|
||||
#if defined(HAVE_OSS_GETVERSION)
|
||||
if( ioctl(fd, OSS_GETVERSION, &version) != 0 )
|
||||
{
|
||||
LOG->Warn( "OSS_GETVERSION failed: %s", strerror(errno) );
|
||||
version = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Find out if /dev/dsp is really ALSA emulating it. ALSA's OSS emulation has
|
||||
* been buggy. If we got here, we probably failed to init ALSA. The only case
|
||||
@@ -131,6 +135,8 @@ void RageSound_OSS::CheckOSSVersion( int fd )
|
||||
RageException::ThrowNonfatal( "RageSound_OSS: ALSA detected. ALSA OSS emulation is buggy; use ALSA natively.");
|
||||
}
|
||||
#endif
|
||||
if( version )
|
||||
{
|
||||
int major, minor, rev;
|
||||
if( version < 361 )
|
||||
{
|
||||
@@ -145,6 +151,7 @@ void RageSound_OSS::CheckOSSVersion( int fd )
|
||||
|
||||
LOG->Info("OSS: %i.%i.%i", major, minor, rev );
|
||||
}
|
||||
}
|
||||
|
||||
RageSound_OSS::RageSound_OSS()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user