aboutsummaryrefslogtreecommitdiff
path: root/audio/dsound_template.h
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-01-14 04:24:29 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-01-14 04:24:29 +0000
commitca9cc28c62a2c2877186569f4ab0cf1034502a73 (patch)
treed46c878d8f03c294452d625c851d6bb3668c5087 /audio/dsound_template.h
parentb34d259a81500d75e4cf435f1e8b262ba7e1421a (diff)
pthreads-based audio and miscellaneous audio clean-up (malc).
ESD support (malc, Frederick Reeve). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3917 c046a42c-6fe2-441c-8c8c-71466251a162
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 0896b04a03..d517c90ce2 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) {
+ dsound_logerr ("Attempt to initialize voice without " NAME2 " object");
+ return -1;
+ }
+
err = waveformat_from_audio_settings (&wfx, as);
if (err) {
return -1;