[Scummvm-git-logs] scummvm master -> 5cf3b75deb345b6e76699a208dd94d4cfcb4ea12
sev-
sev at scummvm.org
Fri Aug 3 14:52:12 CEST 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5cf3b75deb VIDEO: Fix Theora playback when building with Tremor
Commit: 5cf3b75deb345b6e76699a208dd94d4cfcb4ea12
https://github.com/scummvm/scummvm/commit/5cf3b75deb345b6e76699a208dd94d4cfcb4ea12
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2018-08-03T14:52:09+02:00
Commit Message:
VIDEO: Fix Theora playback when building with Tremor
Changed paths:
configure
video/theora_decoder.cpp
diff --git a/configure b/configure
index cd10153..4c82580 100755
--- a/configure
+++ b/configure
@@ -4205,7 +4205,7 @@ echo "$_png"
# Check for Theora Decoder
#
echocheck "libtheoradec >= 1.0"
-if test "$_vorbis" = no ; then
+if test "$_vorbis" = no && test "$_tremor" = no ; then
echo "skipping. no vorbis"
_theoradec=notsupported
fi
diff --git a/video/theora_decoder.cpp b/video/theora_decoder.cpp
index 7ed9738..f00bd48 100644
--- a/video/theora_decoder.cpp
+++ b/video/theora_decoder.cpp
@@ -356,9 +356,11 @@ Audio::AudioStream *TheoraDecoder::VorbisAudioTrack::getAudioStream() const {
#define AUDIOFD_FRAGSIZE 10240
+#ifndef USE_TREMOR
static double rint(double v) {
return floor(v + 0.5);
}
+#endif
bool TheoraDecoder::VorbisAudioTrack::decodeSamples() {
#ifdef USE_TREMOR
@@ -383,7 +385,11 @@ bool TheoraDecoder::VorbisAudioTrack::decodeSamples() {
for (i = 0; i < ret && i < maxsamples; i++) {
for (int j = 0; j < channels; j++) {
+#ifdef USE_TREMOR
+ int val = CLIP(pcm[j][i] >> 9, -32768, 32767);
+#else
int val = CLIP((int)rint(pcm[j][i] * 32767.f), -32768, 32767);
+#endif
_audioBuffer[count++] = val;
}
}
More information about the Scummvm-git-logs
mailing list