aboutsummaryrefslogtreecommitdiffstats
path: root/audio/dsound_template.h
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/dsound_template.h
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/dsound_template.h')
-rw-r--r--audio/dsound_template.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/audio/dsound_template.h b/audio/dsound_template.h
index 0896b04..9cc0b9d 100644
--- a/audio/dsound_template.h
+++ b/audio/dsound_template.h
@@ -23,16 +23,20 @@
*/
#ifdef DSBTYPE_IN
#define NAME "capture buffer"
+#define NAME2 "DirectSoundCapture"
#define TYPE in
#define IFACE IDirectSoundCaptureBuffer
#define BUFPTR LPDIRECTSOUNDCAPTUREBUFFER
#define FIELD dsound_capture_buffer
+#define FIELD2 dsound_capture
#else
#define NAME "playback buffer"
+#define NAME2 "DirectSound"
#define TYPE out
#define IFACE IDirectSoundBuffer
#define BUFPTR LPDIRECTSOUNDBUFFER
#define FIELD dsound_buffer
+#define FIELD2 dsound
#endif
static int glue (dsound_unlock_, TYPE) (
@@ -192,6 +196,11 @@ static int dsound_init_out (HWVoiceOut *hw, audsettings_t *as)
DSBCAPS bc;
#endif
+ if (!s->FIELD2) {
+ dolog ("Attempt to initialize voice without " NAME2 " object\n");
+ return -1;
+ }
+
err = waveformat_from_audio_settings (&wfx, as);
if (err) {
return -1;