aboutsummaryrefslogtreecommitdiff
path: root/audio/dsound_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'audio/dsound_template.h')
-rw-r--r--audio/dsound_template.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/audio/dsound_template.h b/audio/dsound_template.h
index 9f10b688df..7a15f91ce5 100644
--- a/audio/dsound_template.h
+++ b/audio/dsound_template.h
@@ -98,8 +98,8 @@ static int glue (dsound_lock_, TYPE) (
goto fail;
}
- if ((p1p && *p1p && (*blen1p & info->align)) ||
- (p2p && *p2p && (*blen2p & info->align))) {
+ if ((p1p && *p1p && (*blen1p % info->bytes_per_frame)) ||
+ (p2p && *p2p && (*blen2p % info->bytes_per_frame))) {
dolog("DirectSound returned misaligned buffer %ld %ld\n",
*blen1p, *blen2p);
glue(dsound_unlock_, TYPE)(buf, *p1p, p2p ? *p2p : NULL, *blen1p,
@@ -247,14 +247,14 @@ static int dsound_init_out(HWVoiceOut *hw, struct audsettings *as,
obt_as.endianness = 0;
audio_pcm_init_info (&hw->info, &obt_as);
- if (bc.dwBufferBytes & hw->info.align) {
+ if (bc.dwBufferBytes % hw->info.bytes_per_frame) {
dolog (
"GetCaps returned misaligned buffer size %ld, alignment %d\n",
- bc.dwBufferBytes, hw->info.align + 1
+ bc.dwBufferBytes, hw->info.bytes_per_frame
);
}
hw->size_emul = bc.dwBufferBytes;
- hw->samples = bc.dwBufferBytes >> hw->info.shift;
+ hw->samples = bc.dwBufferBytes / hw->info.bytes_per_frame;
ds->s = s;
#ifdef DEBUG_DSOUND