Forward-port 1e6 -> 1000000 fix from master.
authorCarl Hetherington <cth@carlh.net>
Thu, 17 Oct 2013 14:28:54 +0000 (15:28 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 17 Oct 2013 14:28:54 +0000 (15:28 +0100)
ChangeLog
src/wx/config_dialog.cc
src/wx/film_editor.cc

index 30c82818113c355d2eaa85c5c6ce01e8684b3def..431b139b7a9c210cdc96cd7ad9c0c064bc853880 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-17  Carl Hetherington  <cth@carlh.net>
+
+       * Forward-port fix from master; use 1000000 rather
+       than 1e6 for J2K bandwidth arithmetic to ensure
+       that it's done with integers.
+
 2013-10-16  Carl Hetherington  <cth@carlh.net>
 
        * Version 1.17 released.
index d6bc965db9131762f9444215df9eced3053df99f..5479c22cee8857955cc321208264a05ca764e194 100644 (file)
@@ -224,7 +224,7 @@ ConfigDialog::make_misc_panel ()
        _default_dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&ConfigDialog::default_dcp_content_type_changed, this));
 
        _default_j2k_bandwidth->SetRange (50, 250);
-       _default_j2k_bandwidth->SetValue (config->default_j2k_bandwidth() / 1e6);
+       _default_j2k_bandwidth->SetValue (config->default_j2k_bandwidth() / 1000000);
        _default_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ConfigDialog::default_j2k_bandwidth_changed, this));
 }
 
@@ -445,7 +445,7 @@ ConfigDialog::creator_changed ()
 void
 ConfigDialog::default_j2k_bandwidth_changed ()
 {
-       Config::instance()->set_default_j2k_bandwidth (_default_j2k_bandwidth->GetValue() * 1e6);
+       Config::instance()->set_default_j2k_bandwidth (_default_j2k_bandwidth->GetValue() * 1000000);
 }
 
 static std::string
index d502162583d28084da2ebc6f53eca10bfd344d05..f2514da510358bab694432a43fb5e35ba8128ac2 100644 (file)
@@ -315,7 +315,7 @@ FilmEditor::j2k_bandwidth_changed ()
                return;
        }
        
-       _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
+       _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000);
 }
 
 void
@@ -423,7 +423,7 @@ FilmEditor::film_changed (Film::Property p)
                setup_dcp_name ();
                break;
        case Film::J2K_BANDWIDTH:
-               checked_set (_j2k_bandwidth, double (_film->j2k_bandwidth()) / 1e6);
+               checked_set (_j2k_bandwidth, double (_film->j2k_bandwidth()) / 1000000);
                break;
        case Film::USE_DCI_NAME:
                checked_set (_use_dci_name, _film->use_dci_name ());