summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-16 09:51:46 +0100
committerwm4 <wm4@nowhere>2014-03-16 13:19:28 +0100
commit822e040ddb50dd9a1bd888465552e131a9a830ce (patch)
treeb70cc9bf53d6e40b910b80ae2e5d508887f5476e /audio/out
parentc7e620df96630b4e254040087f37a553bc1988df (diff)
downloadmpv-822e040ddb50dd9a1bd888465552e131a9a830ce.tar.bz2
mpv-822e040ddb50dd9a1bd888465552e131a9a830ce.tar.xz
ao_dsound: remove duplicated code
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_dsound.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/audio/out/ao_dsound.c b/audio/out/ao_dsound.c
index aba4d882dc..da0c14cdc2 100644
--- a/audio/out/ao_dsound.c
+++ b/audio/out/ao_dsound.c
@@ -300,23 +300,12 @@ static int write_buffer(struct ao *ao, unsigned char *data, int len)
if (SUCCEEDED(res)) {
- if (!AF_FORMAT_IS_AC3(ao->format)) {
- memcpy(lpvPtr1, data, dwBytes1);
- if (lpvPtr2 != NULL)
- memcpy(lpvPtr2, (char *)data + dwBytes1, dwBytes2);
-
- p->write_offset += dwBytes1 + dwBytes2;
- if (p->write_offset >= p->buffer_size)
- p->write_offset = dwBytes2;
- } else {
- // Write to pointers without reordering.
- memcpy(lpvPtr1, data, dwBytes1);
- if (NULL != lpvPtr2)
- memcpy(lpvPtr2, data + dwBytes1, dwBytes2);
- p->write_offset += dwBytes1 + dwBytes2;
- if (p->write_offset >= p->buffer_size)
- p->write_offset = dwBytes2;
- }
+ memcpy(lpvPtr1, data, dwBytes1);
+ if (NULL != lpvPtr2)
+ memcpy(lpvPtr2, data + dwBytes1, dwBytes2);
+ p->write_offset += dwBytes1 + dwBytes2;
+ if (p->write_offset >= p->buffer_size)
+ p->write_offset = dwBytes2;
// Release the data back to DirectSound.
res = IDirectSoundBuffer_Unlock(p->hdsbuf, lpvPtr1, dwBytes1, lpvPtr2,