Reenable Linux and MacOS travis builds

This commit is contained in:
badaix 2020-04-10 13:51:02 +02:00
parent e5047f1aff
commit adfed6a1a8
3 changed files with 153 additions and 152 deletions

View file

@ -5,164 +5,164 @@ group: edge
matrix:
include:
# - os: linux
# compiler: gcc
# env:
# - COMPILER=g++-4.9
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - ubuntu-toolchain-r-test
# packages:
# - g++-4.9 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-4.9 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: gcc
# env:
# - COMPILER=g++-5
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - ubuntu-toolchain-r-test
# packages:
# - g++-5 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: gcc
env:
- COMPILER=g++-5
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-5 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: gcc
# env:
# - COMPILER=g++-6
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - ubuntu-toolchain-r-test
# packages:
# - g++-6 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: gcc
env:
- COMPILER=g++-6
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-6 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: gcc
# env:
# - COMPILER=g++-7
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - ubuntu-toolchain-r-test
# packages:
# - g++-7 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: gcc
env:
- COMPILER=g++-7
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-7 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: gcc
# env:
# - COMPILER=g++-8
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - ubuntu-toolchain-r-test
# packages:
# - g++-8 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: gcc
env:
- COMPILER=g++-8
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-8 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: gcc
# env:
# - COMPILER=g++-9
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - ubuntu-toolchain-r-test
# packages:
# - g++-9 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: gcc
env:
- COMPILER=g++-9
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- ubuntu-toolchain-r-test
packages:
- g++-9 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: clang
# env:
# - COMPILER=clang++-3.9
# - CXXFLAGS=-stdlib=libc++
# - CC=clang-3.9
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - llvm-toolchain-trusty-3.9
# packages:
# - clang-3.9 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: clang
env:
- COMPILER=clang++-3.9
- CXXFLAGS=-stdlib=libc++
- CC=clang-3.9
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- llvm-toolchain-trusty-3.9
packages:
- clang-3.9 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: clang
# env:
# - COMPILER=clang++-4.0
# - CXXFLAGS=-stdlib=libc++
# - CC=clang-4.0
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - llvm-toolchain-trusty-4.0
# packages:
# - clang-4.0 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: clang
env:
- COMPILER=clang++-4.0
- CXXFLAGS=-stdlib=libc++
- CC=clang-4.0
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: clang
# env:
# - COMPILER=clang++-5.0
# - CXXFLAGS=-stdlib=libc++
# - CC=clang-5.0
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - llvm-toolchain-trusty-5.0
# packages:
# - clang-5.0 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: clang
env:
- COMPILER=clang++-5.0
- CXXFLAGS=-stdlib=libc++
- CC=clang-5.0
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: clang
# env:
# - COMPILER=clang++-6.0
# - CXXFLAGS=-stdlib=libc++
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - llvm-toolchain-trusty-6.0
# - ubuntu-toolchain-r-test
# packages:
# - clang-6.0 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: clang
env:
- COMPILER=clang++-6.0
- CXXFLAGS=-stdlib=libc++
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# - os: linux
# compiler: clang
# env:
# - COMPILER=clang++-7
# - CXXFLAGS=-stdlib=libc++
# addons:
# apt:
# sources:
# - sourceline: 'ppa:mhier/libboost-latest'
# - llvm-toolchain-trusty-7
# - ubuntu-toolchain-r-test
# packages:
# - clang-7 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
- os: linux
compiler: clang
env:
- COMPILER=clang++-7
- CXXFLAGS=-stdlib=libc++
addons:
apt:
sources:
- sourceline: 'ppa:mhier/libboost-latest'
- llvm-toolchain-trusty-7
- ubuntu-toolchain-r-test
packages:
- clang-7 boost1.70 libasound2-dev libsoxr-dev libvorbisidec-dev libvorbis-dev libflac-dev libopus-dev alsa-utils libavahi-client-dev avahi-daemon
# # build on osx
# - os: osx
# osx_image: xcode9.4
# env:
# - MATRIX_EVAL="brew update && brew unlink python@2 && brew upgrade boost && brew install flac opus libvorbis libsoxr"
# build on osx
- os: osx
osx_image: xcode9.4
env:
- MATRIX_EVAL="brew update && brew unlink python@2 && brew upgrade boost && brew install flac opus libvorbis libsoxr"
# - os: osx
# osx_image: xcode10.3
# env:
# - MATRIX_EVAL="brew update && brew install flac opus libvorbis libsoxr"
- os: osx
osx_image: xcode10.3
env:
- MATRIX_EVAL="brew update && brew install flac opus libvorbis libsoxr"
# - os: osx
# osx_image: xcode11
# env:
# - MATRIX_EVAL="brew update && brew install flac opus libvorbis libsoxr"
- os: osx
osx_image: xcode11
env:
- MATRIX_EVAL="brew update && brew install flac opus libvorbis libsoxr"
# build on windows
- os: windows

View file

@ -17,6 +17,7 @@
***/
#include <cmath>
#include <cstdint>
#include <cstring>
#include <iostream>
@ -115,9 +116,9 @@ bool OggDecoder::decode(msg::PcmChunk* chunk)
{
int8_t& val = chunkBuffer[sampleFormat_.channels() * i + channel];
#ifdef HAS_TREMOR
val = clip<int8_t>(pcm[channel][i], -128, 127);
val = clip<int8_t>(pcm[channel][i], INT8_MIN, INT8_MAX);
#else
val = clip<int8_t>(floor(pcm[channel][i] * 127.f + .5f), -128, 127);
val = clip<int8_t>(floor(pcm[channel][i] * 127.f + .5f), INT8_MIN, INT8_MAX);
#endif
}
}
@ -128,9 +129,9 @@ bool OggDecoder::decode(msg::PcmChunk* chunk)
{
int16_t& val = chunkBuffer[sampleFormat_.channels() * i + channel];
#ifdef HAS_TREMOR
val = SWAP_16(clip<int16_t>(pcm[channel][i] >> 9, -32768, 32767));
val = SWAP_16(clip<int16_t>(pcm[channel][i] >> 9, INT16_MIN, INT16_MAX));
#else
val = SWAP_16(clip<int16_t>(floor(pcm[channel][i] * 32767.f + .5f), -32768, 32767));
val = SWAP_16(clip<int16_t>(floor(pcm[channel][i] * 32767.f + .5f), INT16_MIN, INT16_MAX));
#endif
}
}
@ -141,9 +142,9 @@ bool OggDecoder::decode(msg::PcmChunk* chunk)
{
int32_t& val = chunkBuffer[sampleFormat_.channels() * i + channel];
#ifdef HAS_TREMOR
val = SWAP_32(clip<int32_t>(pcm[channel][i] << 7, -2147483648, 2147483647));
val = SWAP_32(clip<int32_t>(pcm[channel][i] << 7, INT32_MIN, INT32_MAX));
#else
val = SWAP_32(clip<int32_t>(floor(pcm[channel][i] * 2147483647.f + .5f), -2147483648, 2147483647));
val = SWAP_32(clip<int32_t>(floor(pcm[channel][i] * 2147483647.f + .5f), INT32_MIN, INT32_MAX));
#endif
}
}

View file

@ -42,12 +42,12 @@ private:
template <typename T, typename IN_TYPE>
T clip(const IN_TYPE& value, const T& lower, const T& upper) const
{
auto val = static_cast<T>(value);
auto val = static_cast<int64_t>(value);
if (val > upper)
return upper;
if (val < lower)
return lower;
return val;
return static_cast<T>(value);
}
ogg_sync_state oy; /// sync and verify incoming physical bitstream