From 7d5089a291d8ba2509bf35957e0929548de6cb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 23 May 2021 02:10:43 +0200 Subject: check value rancge when converting channel count from int --- src/sources/audiosource.h | 2 +- src/sources/audiosourcestereoproxy.cpp | 2 +- src/sources/soundsourcemodplug.cpp | 9 --------- src/sources/soundsourcemodplug.h | 6 +++--- 4 files changed, 5 insertions(+), 14 deletions(-) (limited to 'src/sources') diff --git a/src/sources/audiosource.h b/src/sources/audiosource.h index 6e720f5dbe..52a60b50e0 100644 --- a/src/sources/audiosource.h +++ b/src/sources/audiosource.h @@ -305,7 +305,7 @@ class AudioSource : public UrlResource, public virtual /*implements*/ IAudioSour explicit AudioSource(const QUrl& url); bool initChannelCountOnce(audio::ChannelCount channelCount); - bool initChannelCountOnce(SINT channelCount) { + bool initChannelCountOnce(int channelCount) { return initChannelCountOnce(audio::ChannelCount(channelCount)); } diff --git a/src/sources/audiosourcestereoproxy.cpp b/src/sources/audiosourcestereoproxy.cpp index d32a0ad867..cd2f40233e 100644 --- a/src/sources/audiosourcestereoproxy.cpp +++ b/src/sources/audiosourcestereoproxy.cpp @@ -9,7 +9,7 @@ namespace { const Logger kLogger("AudioSourceStereoProxy"); -constexpr audio::ChannelCount kChannelCount = audio::ChannelCount(2); +constexpr audio::ChannelCount kChannelCount = audio::ChannelCount::stereo(); audio::SignalInfo proxySignalInfo( const audio::SignalInfo& signalInfo) { diff --git a/src/sources/soundsourcemodplug.cpp b/src/sources/soundsourcemodplug.cpp index fb637ec919..69a569aa38 100644 --- a/src/sources/soundsourcemodplug.cpp +++ b/src/sources/soundsourcemodplug.cpp @@ -54,15 +54,6 @@ QString getModPlugTypeFromUrl(const QUrl& url) { } // anonymous namespace -//static -constexpr SINT SoundSourceModPlug::kChannelCount; - -//static -constexpr SINT SoundSourceModPlug::kBitsPerSample; - -//static -constexpr SINT SoundSourceModPlug::kSampleRate; - //static unsigned int SoundSourceModPlug::s_bufferSizeLimit = 0; diff --git a/src/sources/soundsourcemodplug.h b/src/sources/soundsourcemodplug.h index baed964810..e05992e5bb 100644 --- a/src/sources/soundsourcemodplug.h +++ b/src/sources/soundsourcemodplug.h @@ -15,9 +15,9 @@ namespace mixxx { // in RAM to allow seeking and smooth operation in Mixxx. class SoundSourceModPlug : public SoundSource { public: - static constexpr SINT kChannelCount = 2; - static constexpr SINT kSampleRate = 44100; - static constexpr SINT kBitsPerSample = 16; + static constexpr int kChannelCount = 2; + static constexpr int kSampleRate = 44100; + static constexpr int kBitsPerSample = 16; // apply settings for decoding static void configure(unsigned int bufferSizeLimit, -- cgit v1.2.3