Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarVoice.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-02-20 09:49:42 +1100
committerGitHub <noreply@github.com>2024-02-20 09:49:42 +1100
commitaa987a217779e71f97ee4c9cce531aec1c861bf8 (patch)
treee51fcce110306d93bf93870f13a5ff7d6b575427 /source/frontend/StarVoice.cpp
parentd0099a6d790b66f21e4e266e569d64fb82fb0a81 (diff)
parent1c89042016c739815b2d70bcbef4673eef6b63e0 (diff)
Merge branch 'main' into small-fixes
Diffstat (limited to 'source/frontend/StarVoice.cpp')
-rw-r--r--source/frontend/StarVoice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp
index 68b83ae..fc1c5a9 100644
--- a/source/frontend/StarVoice.cpp
+++ b/source/frontend/StarVoice.cpp
@@ -61,7 +61,8 @@ float getAudioLoudness(int16_t* data, size_t samples, float volume = 1.0f) {
return highest;
}
-struct VoiceAudioStream {
+class VoiceAudioStream {
+public:
// TODO: This should really be a ring buffer instead.
std::queue<int16_t> samples;
SDL_AudioStream* sdlAudioStreamMono;
@@ -173,7 +174,7 @@ template <typename T>
inline bool change(T& value, T newValue, bool& out) {
bool changed = value != newValue;
out |= changed;
- value = move(newValue);
+ value = std::move(newValue);
return changed;
}
@@ -480,7 +481,7 @@ int Voice::send(DataStreamBuffer& out, size_t budget) {
if (m_encodedChunks.empty())
return 0;
- std::vector<ByteArray> encodedChunks = move(m_encodedChunks);
+ std::vector<ByteArray> encodedChunks = std::move(m_encodedChunks);
size_t encodedChunksLength = m_encodedChunksLength;
m_encodedChunksLength = 0;
@@ -692,7 +693,7 @@ void Voice::thread() {
{
MutexLocker lock(m_encodeMutex);
- m_encodedChunks.emplace_back(move(encoded));
+ m_encodedChunks.emplace_back(std::move(encoded));
m_encodedChunksLength += encodedSize;
encoded = ByteArray(VOICE_MAX_PACKET_SIZE, 0);