Updated zh_CN translation from 刘汉源.
[dcpomatic.git] / src / wx / timing_panel.cc
index d7ed46f467eca85192d6b6c355cf375830a72d9b..653e4466955e55e880683cb054ee2daaa84afad7 100644 (file)
@@ -409,9 +409,16 @@ TimingPanel::video_frame_rate_changed ()
 void
 TimingPanel::set_video_frame_rate ()
 {
-       double const fr = locale_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
+       optional<double> fr;
+       if (_video_frame_rate->GetValue() != wxT("")) {
+               fr = locale_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
+       }
        BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
-               i->set_video_frame_rate (fr);
+               if (fr) {
+                       i->set_video_frame_rate (*fr);
+               } else {
+                       i->unset_video_frame_rate ();
+               }
        }
 
        _set_video_frame_rate->Enable (false);