[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive] src/project: Fix GCC warnings (float comparison)
From:       Vincent Pinon <null () kde ! org>
Date:       2017-02-28 23:03:40
Message-ID: E1ciqo0-0003Xj-AU () code ! kde ! org
[Download RAW message or body]

Git commit e6f89c53361cf2134de1eebd1981469a38aa929b by Vincent Pinon.
Committed on 28/02/2017 at 22:31.
Pushed by vpinon into branch 'master'.

Fix GCC warnings (float comparison)

M  +1    -1    src/project/dialogs/clipspeed.cpp
M  +1    -1    src/project/jobs/cutclipjob.cpp
M  +1    -1    src/project/jobs/meltjob.cpp
M  +1    -1    src/project/jobs/proxyclipjob.cpp

https://commits.kde.org/kdenlive/e6f89c53361cf2134de1eebd1981469a38aa929b

diff --git a/src/project/dialogs/clipspeed.cpp b/src/project/dialogs/clipspeed.cpp
index 87d2c88a8..7cc922d66 100644
--- a/src/project/dialogs/clipspeed.cpp
+++ b/src/project/dialogs/clipspeed.cpp
@@ -61,7 +61,7 @@ void ClipSpeed::slotUpdateSlider(double speed)
     m_view.speedSlider->blockSignals(true);
     m_view.speedSlider->setValue((int) speed);
     m_view.speedSlider->blockSignals(false);
-    m_view.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(speed != 0.0);
+    m_view.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(qAbs(speed) > 1e-6);
 }
 
 void ClipSpeed::slotUpdateSpeed(int speed)
diff --git a/src/project/jobs/cutclipjob.cpp b/src/project/jobs/cutclipjob.cpp
index ab461bb54..65b720599 100644
--- a/src/project/jobs/cutclipjob.cpp
+++ b/src/project/jobs/cutclipjob.cpp
@@ -286,7 +286,7 @@ QHash<ProjectClip *, AbstractClipJob *> \
CutClipJob::prepareCutClipJob(double fps  QString ext = \
                source.section(QLatin1Char('.'), -1);
     QString dest = source.section(QLatin1Char('.'), 0, -2) + QLatin1Char('_') + \
QString::number(zone.x()) + QLatin1Char('.') + ext;  
-    if (originalFps == 0) {
+    if (originalFps < 1e-6) {
         originalFps = fps;
     }
     // if clip and project have different frame rate, adjust in and out
diff --git a/src/project/jobs/meltjob.cpp b/src/project/jobs/meltjob.cpp
index d9312b5b3..96aedcfad 100644
--- a/src/project/jobs/meltjob.cpp
+++ b/src/project/jobs/meltjob.cpp
@@ -117,7 +117,7 @@ void MeltJob::startJob()
         m_profile->from_producer(*producer);
         m_profile->set_explicit(true);
     }
-    if (m_profile->fps() != fps || producerProfile) {
+    if (qAbs(m_profile->fps() - fps) > 0.01 || producerProfile) {
         // Reload producer
         delete producer;
         // Force same fps as projec profile or the resulting .mlt will not load in \
                our project
diff --git a/src/project/jobs/proxyclipjob.cpp b/src/project/jobs/proxyclipjob.cpp
index de2c44661..b5b0b910c 100644
--- a/src/project/jobs/proxyclipjob.cpp
+++ b/src/project/jobs/proxyclipjob.cpp
@@ -63,7 +63,7 @@ void ProxyJob::startJob()
         } else {
             display_ratio = KdenliveDoc::getDisplayRatio(m_src);
         }
-        if (display_ratio == 0) {
+        if (display_ratio < 1e-6) {
             display_ratio = 1;
         }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic