aboutsummaryrefslogtreecommitdiff
path: root/graphics/video
diff options
context:
space:
mode:
authorSven Hesse2009-07-28 15:19:55 +0000
committerSven Hesse2009-07-28 15:19:55 +0000
commitf5e9aa67c495a64117cc9d30596a34fbe21ef1d5 (patch)
tree0accb0460a61769eafeeefed9b3f4ac275aa2258 /graphics/video
parentf832d0fc5692133bb3c38c1b19e87f315a8a80fc (diff)
downloadscummvm-rg350-f5e9aa67c495a64117cc9d30596a34fbe21ef1d5.tar.gz
scummvm-rg350-f5e9aa67c495a64117cc9d30596a34fbe21ef1d5.tar.bz2
scummvm-rg350-f5e9aa67c495a64117cc9d30596a34fbe21ef1d5.zip
Changing stuff around a bit so alignment requirements won't increase
svn-id: r42857
Diffstat (limited to 'graphics/video')
-rw-r--r--graphics/video/coktelvideo/coktelvideo.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp
index 47c8e527d3..efcd77de44 100644
--- a/graphics/video/coktelvideo/coktelvideo.cpp
+++ b/graphics/video/coktelvideo/coktelvideo.cpp
@@ -1973,11 +1973,10 @@ byte *Vmd::deDPCM(const byte *data, uint32 &size, int32 init[2]) {
int channels = (_soundStereo > 0) ? 2 : 1;
uint32 inSize = size;
- uint32 outSize = (size + channels) * 2;
+ uint32 outSize = size + channels;
- byte *sound = new byte[outSize];
-
- int16 *out = (int16 *) sound;
+ int16 *out = new int16[outSize];
+ byte *sound = (byte *) out;
int channel = 0;
@@ -1999,7 +1998,7 @@ byte *Vmd::deDPCM(const byte *data, uint32 &size, int32 init[2]) {
channel = (channel + 1) % channels;
}
- size = outSize;
+ size = outSize * 2;
return sound;
}
@@ -2008,10 +2007,10 @@ byte *Vmd::deADPCM(const byte *data, uint32 &size, int32 init, int32 index) {
if (!data || (size == 0))
return 0;
- uint32 outSize = size * 4;
+ uint32 outSize = size * 2;
- byte *sound = new byte[outSize];
- int16 *out = (int16 *) sound;
+ int16 *out = new int16[outSize];
+ byte *sound = (byte *) out;
index = CLIP<int32>(index, 0, 88);
@@ -2056,7 +2055,7 @@ byte *Vmd::deADPCM(const byte *data, uint32 &size, int32 init, int32 index) {
*out++ = TO_BE_16(init);
}
- size = outSize;
+ size = outSize * 2;
return sound;
}