summaryrefslogtreecommitdiffstats
path: root/src/sources
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2021-05-23 02:10:43 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2021-05-23 13:27:53 +0200
commit7d5089a291d8ba2509bf35957e0929548de6cb2a (patch)
tree074b37b14d05353f3597e778a73ff401fe80d013 /src/sources
parentc351234ff436707988635076b184393ba9d4b101 (diff)
check value rancge when converting channel count from int
Diffstat (limited to 'src/sources')
-rw-r--r--src/sources/audiosource.h2
-rw-r--r--src/sources/audiosourcestereoproxy.cpp2
-rw-r--r--src/sources/soundsourcemodplug.cpp9
-rw-r--r--src/sources/soundsourcemodplug.h6
4 files changed, 5 insertions, 14 deletions
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
@@ -55,15 +55,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;
//static
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,