aboutsummaryrefslogtreecommitdiff
path: root/video/bink_decoder.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-02 19:23:49 -0400
committerMatthew Hoops2011-07-02 19:23:49 -0400
commit82ed30817d539486912a394222d32975b5db2c0a (patch)
tree0f7e316082e6a40cdd4e17f72893843810fcfa9f /video/bink_decoder.cpp
parent4c065363a05589ab761d24dc7a25da592ba69934 (diff)
downloadscummvm-rg350-82ed30817d539486912a394222d32975b5db2c0a.tar.gz
scummvm-rg350-82ed30817d539486912a394222d32975b5db2c0a.tar.bz2
scummvm-rg350-82ed30817d539486912a394222d32975b5db2c0a.zip
VIDEO: Cleanup Bink a bit
- Fix playing videos back-to-back - Silence a cast warning
Diffstat (limited to 'video/bink_decoder.cpp')
-rw-r--r--video/bink_decoder.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/video/bink_decoder.cpp b/video/bink_decoder.cpp
index 79bcdc1890..5ed4011b61 100644
--- a/video/bink_decoder.cpp
+++ b/video/bink_decoder.cpp
@@ -129,23 +129,22 @@ void BinkDecoder::close() {
_audioStarted = false;
for (int i = 0; i < 4; i++) {
- delete[] _curPlanes[i];
- delete[] _oldPlanes[i];
+ delete[] _curPlanes[i]; _curPlanes[i] = 0;
+ delete[] _oldPlanes[i]; _oldPlanes[i] = 0;
}
deinitBundles();
- for (int i = 0; i < 16; i++)
+ for (int i = 0; i < 16; i++) {
delete _huffman[i];
+ _huffman[i] = 0;
+ }
delete _bink; _bink = 0;
_surface.free();
_audioTrack = 0;
- for (int i = 0; i < 16; i++)
- _huffman[i] = 0;
-
for (int i = 0; i < kSourceMAX; i++) {
_bundles[i].countLength = 0;
@@ -165,10 +164,8 @@ void BinkDecoder::close() {
_colHighHuffman[i].symbols[j] = j;
}
- for (int i = 0; i < 4; i++) {
- _curPlanes[i] = 0;
- _oldPlanes[i] = 0;
- }
+ _audioTracks.clear();
+ _frames.clear();
}
uint32 BinkDecoder::getElapsedTime() const {
@@ -1423,7 +1420,7 @@ void BinkDecoder::audioBlock(AudioTrack &audio, int16 *out) {
for (uint32 j = 0; j < audio.frameLen; j++)
audio.coeffsPtr[i][j] = 385.0 + audio.coeffsPtr[i][j] * (1.0 / 32767.0);
- floatToInt16Interleave(out, (const float **)audio.coeffsPtr, audio.frameLen, audio.channels);
+ floatToInt16Interleave(out, const_cast<const float **>(audio.coeffsPtr), audio.frameLen, audio.channels);
if (!audio.first) {
int count = audio.overlapLen * audio.channels;