summaryrefslogtreecommitdiffstats
path: root/libao2/ao_oss.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-03 11:38:35 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-03 11:38:35 +0000
commita1af27beb47a25c31a74e7623acb6713913e94f4 (patch)
treece366ae05f0c70e96614d89aa0c3043c6e256ff1 /libao2/ao_oss.c
parent3c93e7b558352f44136a19b0186040425c7cfbb2 (diff)
downloadmpv-a1af27beb47a25c31a74e7623acb6713913e94f4.tar.bz2
mpv-a1af27beb47a25c31a74e7623acb6713913e94f4.tar.xz
QUERY_FORMAT support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15899 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_oss.c')
-rw-r--r--libao2/ao_oss.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c
index 121aa009ea..393d8b065e 100644
--- a/libao2/ao_oss.c
+++ b/libao2/ao_oss.c
@@ -160,8 +160,16 @@ static int control(int cmd,void *arg){
case AOCONTROL_GET_DEVICE:
*(char**)arg=dsp;
return CONTROL_OK;
+#ifdef SNDCTL_DSP_GETFMTS
case AOCONTROL_QUERY_FORMAT:
- return CONTROL_TRUE;
+ {
+ int format;
+ if (!ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &format))
+ if (format & (int)arg)
+ return CONTROL_TRUE;
+ return CONTROL_FALSE;
+ }
+#endif
case AOCONTROL_GET_VOLUME:
case AOCONTROL_SET_VOLUME:
{