aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2010-01-08 11:26:27 +0300
committerAurelien Jarno <aurelien@aurel32.net>2010-04-25 12:19:39 +0200
commitb09ac1abe7691988d52082f9108cc8a18add9389 (patch)
tree9ac458edbb29609878443b38fec1b64fbb453337
parentblock: Free iovec arrays allocated by multiwrite_merge() (diff)
downloadqemu-kvm-b09ac1abe7691988d52082f9108cc8a18add9389.tar.gz
qemu-kvm-b09ac1abe7691988d52082f9108cc8a18add9389.tar.bz2
qemu-kvm-b09ac1abe7691988d52082f9108cc8a18add9389.zip
oss: workaround for cases when OSS_GETVERSION is not defined
Thanks to Juergen Lock. Signed-off-by: malc <av1474@comtv.ru> (cherry picked from commit e726fe7d60d46636c74c1c4a8fac7e4a05efb163)
-rw-r--r--audio/ossaudio.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 4002f1467..4766aa725 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -240,7 +240,9 @@ static int oss_open (int in, struct oss_params *req,
struct oss_params *obt, int *pfd)
{
int fd;
+#ifdef OSS_GETVERSION
int version;
+#endif
int oflags = conf.exclusive ? O_EXCL : 0;
audio_buf_info abinfo;
int fmt, freq, nchannels;
@@ -281,6 +283,7 @@ static int oss_open (int in, struct oss_params *req,
goto err;
}
+#ifdef OSS_GETVERSION
if (ioctl (fd, OSS_GETVERSION, &version)) {
oss_logerr2 (errno, typ, "Failed to get OSS version\n");
version = 0;
@@ -289,9 +292,17 @@ static int oss_open (int in, struct oss_params *req,
if (conf.debug) {
dolog ("OSS version = %#x\n", version);
}
+#endif
#ifdef SNDCTL_DSP_POLICY
- if (conf.policy >= 0 && version >= 0x040000) {
+ if (conf.policy >= 0
+#ifdef OSS_GETVERSION
+ && version >= 0x040000
+#else
+ 0
+#endif
+ )
+ {
int policy = conf.policy;
if (ioctl (fd, SNDCTL_DSP_POLICY, &policy)) {
oss_logerr2 (errno, typ, "Failed to set timing policy to %d\n",