diff --git a/source/common/audio/music/music.cpp b/source/common/audio/music/music.cpp index 349aff3b5..645cb9a01 100644 --- a/source/common/audio/music/music.cpp +++ b/source/common/audio/music/music.cpp @@ -97,7 +97,7 @@ static std::unique_ptr musicStream; SoundStream *S_CreateCustomStream(size_t size, int samplerate, int numchannels, StreamCallback cb, void *userdata) { - int flags = SoundStream::Float; + int flags = 0; if (numchannels < 2) flags |= SoundStream::Mono; auto stream = GSnd->CreateStream(cb, size, flags, samplerate, userdata); if (stream) stream->Play(true, 1); diff --git a/source/core/movie/playmve.cpp b/source/core/movie/playmve.cpp index 9e8f141e7..b1d30c709 100644 --- a/source/core/movie/playmve.cpp +++ b/source/core/movie/playmve.cpp @@ -103,21 +103,24 @@ static int ClipRange(int val, int min, int max) static bool StreamCallbackFunc(SoundStream* stream, void* buff, int len, void* userdata) { InterplayDecoder* pId = (InterplayDecoder*)userdata; - uint8_t* buf = (uint8_t*)buff; + int16_t* buf = (int16_t*)buff; + len /= 2; // we're copying 16 bit values. while (len > 0) { uint32_t nSize = pId->audio.block[pId->audio.nRead].size; - auto ptr = (uint8_t*)pId->audio.block[pId->audio.nRead].buf; + auto ptr = pId->audio.block[pId->audio.nRead].buf; auto copyofs = pId->audio.nSubIndex; auto copylen = std::min(len, nSize - copyofs); - memcpy(buf, ptr, copylen); + for(int i=0;iaudio.nSubIndex += copylen; - buf += copylen; len -= copylen; if (pId->audio.nSubIndex == nSize) { pId->audio.nSubIndex = 0; pId->audio.nRead++; + if (pId->audio.nRead >= InterplayDecoder::kAudioBlocks) pId->audio.nRead = 0; + } } return true; diff --git a/source/core/movie/playmve.h b/source/core/movie/playmve.h index 5f51a5158..cbeecbff5 100644 --- a/source/core/movie/playmve.h +++ b/source/core/movie/playmve.h @@ -53,6 +53,7 @@ class InterplayDecoder { +public: enum { CHUNK_PREAMBLE_SIZE = 4, @@ -97,7 +98,6 @@ class InterplayDecoder kAudioBlocks = 20 // alloc a lot of blocks - need to store lots of audio data before video frames start. }; -public: InterplayDecoder(); ~InterplayDecoder(); diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index b4615a0f8..e874fde55 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -202,7 +202,7 @@ public: twod->ClearScreen(); DrawTexture(twod, decoder.animTex().GetFrame(), 0, 0, DTA_FullscreenEx, 3, TAG_DONE); - return skiprequest ? -1 : playon ? 1 : 0; + return /* skiprequest ? -1 :*/ playon ? 1 : 0; } void OnDestroy() override