aboutsummaryrefslogtreecommitdiffstats
path: root/audio/dsoundaudio.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:59 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:59 -0800
commitc27f813900a3c114562efbb8df1065e94766fc48 (patch)
treed95919283707dcab61009e27007374a745c9541e /audio/dsoundaudio.c
parent0852ad57fa372f9b2854e4df685eaba8d8ef6790 (diff)
downloadexternal_qemu-c27f813900a3c114562efbb8df1065e94766fc48.zip
external_qemu-c27f813900a3c114562efbb8df1065e94766fc48.tar.gz
external_qemu-c27f813900a3c114562efbb8df1065e94766fc48.tar.bz2
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'audio/dsoundaudio.c')
-rw-r--r--audio/dsoundaudio.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 6104acb..8284067 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -26,12 +26,14 @@
* SEAL 1.07 by Carlos 'pel' Hasan was used as documentation
*/
-#include "vl.h"
+#include "audio.h"
#define AUDIO_CAP "dsound"
#include "audio_int.h"
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#include <mmsystem.h>
#include <objbase.h>
#include <dsound.h>
@@ -317,23 +319,22 @@ static int waveformat_from_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
switch (as->fmt) {
case AUD_FMT_S8:
- wfx->wBitsPerSample = 8;
- break;
-
case AUD_FMT_U8:
wfx->wBitsPerSample = 8;
break;
case AUD_FMT_S16:
+ case AUD_FMT_U16:
wfx->wBitsPerSample = 16;
wfx->nAvgBytesPerSec <<= 1;
wfx->nBlockAlign <<= 1;
break;
- case AUD_FMT_U16:
- wfx->wBitsPerSample = 16;
- wfx->nAvgBytesPerSec <<= 1;
- wfx->nBlockAlign <<= 1;
+ case AUD_FMT_S32:
+ case AUD_FMT_U32:
+ wfx->wBitsPerSample = 32;
+ wfx->nAvgBytesPerSec <<= 2;
+ wfx->nBlockAlign <<= 2;
break;
default:
@@ -384,8 +385,13 @@ static int waveformat_to_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
as->fmt = AUD_FMT_S16;
break;
+ case 32:
+ as->fmt = AUD_FMT_S32;
+ break;
+
default:
- dolog ("Invalid wave format, bits per sample is not 8 or 16, but %d\n",
+ dolog ("Invalid wave format, bits per sample is not "
+ "8, 16 or 32, but %d\n",
wfx->wBitsPerSample);
return -1;
}