diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-05-27 15:44:20 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-05-28 12:26:26 +0200 |
commit | 962a98356ff5ee55da17d77fcdc074e07477b403 (patch) | |
tree | 887136d5ba31bbbbc5604d725846dc06f485cf7e /src/encoder | |
parent | 51d9f8e08a7a259ba31cd6db766166f09c7c1557 (diff) |
Use QRandomGenerator instead of qrand/qsrand
Diffstat (limited to 'src/encoder')
-rw-r--r-- | src/encoder/encoderopus.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/encoder/encoderopus.cpp b/src/encoder/encoderopus.cpp index 98ff966f96..dbd303a6f7 100644 --- a/src/encoder/encoderopus.cpp +++ b/src/encoder/encoderopus.cpp @@ -1,17 +1,19 @@ // encoderopus.cpp // Create on August 15th 2017 by Palakis +#include "encoder/encoderopus.h" + #include <stdlib.h> + #include <QByteArray> #include <QMapIterator> +#include <QRandomGenerator> #include <QtGlobal> #include "encoder/encoderopussettings.h" #include "engine/sidechain/enginesidechain.h" #include "util/logger.h" -#include "encoder/encoderopus.h" - namespace { // From libjitsi's Opus encoder: // 1 byte TOC + maximum frame size (1275) @@ -63,8 +65,8 @@ int getSerial() { int serial; do { - serial = qrand(); - } while(prevSerial == serial); + serial = static_cast<int>(QRandomGenerator::global()->generate()); + } while (prevSerial == serial); prevSerial = serial; kLogger.debug() << "RETURNING SERIAL " << serial; @@ -110,7 +112,7 @@ EncoderOpus::EncoderOpus(EncoderCallback* pCallback) // the Live Broadcasting implementation m_opusComments.insert("ENCODER", "mixxx/libopus"); - ogg_stream_init(&m_oggStream, qrand()); + ogg_stream_init(&m_oggStream, static_cast<int>(QRandomGenerator::global()->generate())); } EncoderOpus::~EncoderOpus() { |