summaryrefslogtreecommitdiff
path: root/src/wx/timing_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-13 22:49:51 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-14 00:24:46 +0000
commit97ce603137dace8e85fe72975644c220d7fa9ae8 (patch)
tree41828939af011b0af8241e4bacf195d34035344e /src/wx/timing_panel.cc
parent66ce3b83877b3d7b95f6cd424fc9516e0bf79aa9 (diff)
Fix crash when unsetting forced video frame rates in the timing panel.
Diffstat (limited to 'src/wx/timing_panel.cc')
-rw-r--r--src/wx/timing_panel.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index d7ed46f46..653e44669 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -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);