From 665a03f9e23973a626abcc9520071fe1f6644142 Mon Sep 17 00:00:00 2001 From: Sergey Parfenyuk Date: Sat, 27 Apr 2019 12:50:31 +0200 Subject: [PATCH] Fix logical statements --- src/AudioResampler.cpp | 4 ++-- src/KeyFrame.cpp | 2 +- src/QtImageReader.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AudioResampler.cpp b/src/AudioResampler.cpp index 442a91d9..d7829ec5 100644 --- a/src/AudioResampler.cpp +++ b/src/AudioResampler.cpp @@ -74,9 +74,9 @@ AudioResampler::~AudioResampler() void AudioResampler::SetBuffer(AudioSampleBuffer *new_buffer, double sample_rate, double new_sample_rate) { if (sample_rate <= 0) - sample_rate == 44100; + sample_rate = 44100; if (new_sample_rate <= 0) - new_sample_rate == 44100; + new_sample_rate = 44100; // Set the sample ratio (the ratio of sample rate change) source_ratio = sample_rate / new_sample_rate; diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index 025484a3..a2c2362d 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -784,7 +784,7 @@ void Keyframe::ProcessSegment(int Segment, Point p1, Point p2) { // Add new value to the vector Coordinate new_coord(current_frame, current_value); - if (Segment == 0 || Segment > 0 && current_frame > p1.co.X) + if (Segment == 0 || (Segment > 0 && current_frame > p1.co.X)) // Add to "values" vector Values.push_back(new_coord); diff --git a/src/QtImageReader.cpp b/src/QtImageReader.cpp index c500d221..8cc2debc 100644 --- a/src/QtImageReader.cpp +++ b/src/QtImageReader.cpp @@ -209,7 +209,7 @@ std::shared_ptr QtImageReader::GetFrame(int64_t requested_frame) } // Scale image smaller (or use a previous scaled image) - if (!cached_image || (cached_image && cached_image->width() != max_width || cached_image->height() != max_height)) { + if (!cached_image || (cached_image->width() != max_width || cached_image->height() != max_height)) { #if USE_RESVG == 1 // If defined and found in CMake, utilize the libresvg for parsing