correct CodeQL problems

This commit is contained in:
Paulchen-Panther
2023-10-16 13:43:58 +02:00
parent f117a769b5
commit bbf0a72f88
5 changed files with 30 additions and 40 deletions

View File

@@ -209,11 +209,6 @@ bool AudioGrabberLinux::start()
_isRunning.store(true, std::memory_order_release);
pthread_attr_t threadAttributes;
// int threadPriority = 1;
// sched_param schedulerParameter;
// schedulerParameter.sched_priority = threadPriority;
if (pthread_attr_init(&threadAttributes) != 0)
{
Debug(_log, "Failed to create thread attributes");

View File

@@ -1018,7 +1018,7 @@ bool V4L2Grabber::process_image(const void *p, int size)
}
else if (_threadManager != nullptr)
{
for (unsigned long i = 0; i < _threadManager->_threadCount; i++)
for (int i = 0; i < _threadManager->_threadCount; i++)
{
if (!_threadManager->_threads[i]->isBusy())
{
@@ -1290,11 +1290,11 @@ QJsonArray V4L2Grabber::discover(const QJsonObject& params)
format["format"] = pixelFormatToString(encodingFormat);
QMap<std::pair<int, int>, QSet<int>> combined = QMap<std::pair<int, int>, QSet<int>>();
for (auto enc : input.value().encodingFormats.values(encodingFormat))
for (const auto &enc : input.value().encodingFormats.values(encodingFormat))
{
std::pair<int, int> width_height{enc.width, enc.height};
auto &com = combined[width_height];
for (auto framerate : qAsConst(enc.framerates))
for (auto framerate : enc.framerates)
{
com.insert(framerate);
}
@@ -1326,7 +1326,7 @@ QJsonArray V4L2Grabber::discover(const QJsonObject& params)
device["video_inputs"] = video_inputs;
QJsonObject controls, controls_default;
for (const auto &control : qAsConst(_deviceControls[device_property.key()]))
for (const auto &control : std::as_const(_deviceControls[device_property.key()]))
{
QJsonObject property;
property["minValue"] = control.minValue;