diff --git a/Engine/source/sfx/media/sfxSndStream.cpp b/Engine/source/sfx/media/sfxSndStream.cpp index f7eedff92..ef1d20dc4 100644 --- a/Engine/source/sfx/media/sfxSndStream.cpp +++ b/Engine/source/sfx/media/sfxSndStream.cpp @@ -128,6 +128,7 @@ void SFXSndStream::setPosition(U32 offset) sf_count_t SFXSndStream::sndSeek(sf_count_t offset, int whence, void* user_data) { VIO_DATA* vf = (VIO_DATA*)user_data; + Stream* stream = reinterpret_cast(vf->data); switch (whence) { @@ -140,13 +141,13 @@ sf_count_t SFXSndStream::sndSeek(sf_count_t offset, int whence, void* user_data) break; case SEEK_END: - vf->offset = vf->length + offset; + vf->offset = vf->length - offset; break; default: break; }; - return vf->offset; + return stream->setPosition(vf->offset) ? 0 : -1; } sf_count_t SFXSndStream::sndRead(void* ptr, sf_count_t count, void* user_data) @@ -157,8 +158,7 @@ sf_count_t SFXSndStream::sndRead(void* ptr, sf_count_t count, void* user_data) if (vf->offset + count > vf->length) count = vf->length - vf->offset; - stream->read((U32)(count), reinterpret_cast(ptr)); - + stream->read((U32)(count), ptr); vf->offset += count; return count; diff --git a/Engine/source/sfx/sfxProfile.cpp b/Engine/source/sfx/sfxProfile.cpp index 37a55053b..2af2cb6e2 100644 --- a/Engine/source/sfx/sfxProfile.cpp +++ b/Engine/source/sfx/sfxProfile.cpp @@ -350,7 +350,7 @@ SFXBuffer* SFXProfile::_createBuffer() Con::printf( "%s SFX: %s (%i channels, %i kHz, %.02f sec, %i kb)", mDescription->mIsStreaming ? "Streaming" : "Loading", resource->getFileName().c_str(), format.getChannels(), - format.getSamplesPerSecond() / 1000, + format.getSamplesPerSecond(), F32( resource->getDuration() ) / 1000.0f, format.getDataLength( resource->getDuration() ) / 1024 ); #endif