use HAVE_OSS_GETVERSION

don't print "version 0.0.0" if ioctl(OSS_GETVERSION) fails
This commit is contained in:
Glenn Maynard
2004-05-06 09:30:03 +00:00
parent 46c51ad33a
commit d3c19e9a46
@@ -103,12 +103,16 @@ int64_t RageSound_OSS::GetPosition(const RageSoundBase *snd) const
void RageSound_OSS::CheckOSSVersion( int fd ) void RageSound_OSS::CheckOSSVersion( int fd )
{ {
int version; int version = 0;
#if defined(HAVE_OSS_GETVERSION)
if( ioctl(fd, OSS_GETVERSION, &version) != 0 ) if( ioctl(fd, OSS_GETVERSION, &version) != 0 )
{ {
LOG->Warn( "OSS_GETVERSION failed: %s", strerror(errno) ); LOG->Warn( "OSS_GETVERSION failed: %s", strerror(errno) );
version = 0; version = 0;
} }
#endif
/* /*
* Find out if /dev/dsp is really ALSA emulating it. ALSA's OSS emulation has * 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 * 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."); RageException::ThrowNonfatal( "RageSound_OSS: ALSA detected. ALSA OSS emulation is buggy; use ALSA natively.");
} }
#endif #endif
if( version )
{
int major, minor, rev; int major, minor, rev;
if( version < 361 ) if( version < 361 )
{ {
@@ -145,6 +151,7 @@ void RageSound_OSS::CheckOSSVersion( int fd )
LOG->Info("OSS: %i.%i.%i", major, minor, rev ); LOG->Info("OSS: %i.%i.%i", major, minor, rev );
} }
}
RageSound_OSS::RageSound_OSS() RageSound_OSS::RageSound_OSS()
{ {