summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_dsound.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_dsound.c')
-rw-r--r--audio/out/ao_dsound.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c
index 58812d80e6..f828a210dc 100644
--- a/audio/out/ao_dsound.c
+++ b/audio/out/ao_dsound.c
@@ -596,7 +596,7 @@ static int get_space(struct ao *ao)
int space = check_free_buffer_size(ao);
if (space < p->min_free_space)
return 0;
- return space - p->min_free_space;
+ return (space - p->min_free_space) / ao->sstride;
}
/**
@@ -606,9 +606,10 @@ static int get_space(struct ao *ao)
\param flags currently unused
\return number of played bytes
*/
-static int play(struct ao *ao, void *data, int len, int flags)
+static int play(struct ao *ao, void **data, int samples, int flags)
{
struct priv *p = ao->priv;
+ int len = samples * ao->sstride;
int space = check_free_buffer_size(ao);
if (space < len)
@@ -616,7 +617,7 @@ static int play(struct ao *ao, void *data, int len, int flags)
if (!(flags & AOPLAY_FINAL_CHUNK))
len = (len / p->outburst) * p->outburst;
- return write_buffer(ao, data, len);
+ return write_buffer(ao, data[0], len) / ao->sstride;
}
/**