changeset 15898:a45af202818f

QUERY_FORMAT support
author alex
date Sun, 03 Jul 2005 11:38:35 +0000
parents 18e74f0452c7
children 4dae64f90af0
files libao2/ao_oss.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_oss.c	Sun Jul 03 11:34:18 2005 +0000
+++ b/libao2/ao_oss.c	Sun Jul 03 11:38:35 2005 +0000
@@ -160,8 +160,16 @@
 	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:
 	{