summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-30 14:56:47 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-30 14:56:47 +0100
commita14d71f1aaac3054ed6a9042f91862082d9ea1b7 (patch)
treea4a6ce98c3530e274050fc4ffc117aad516923f2
parentd2ca18d5b2a3351745cc8be2840308808e5a2d36 (diff)
Fix recently-broken video frame rate override control sensitivity.
-rw-r--r--ChangeLog4
-rw-r--r--src/wx/timing_panel.cc44
2 files changed, 23 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d10859fa..5fa89b771 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-30 c.hetherington <cth@carlh.net>
+
+ * Fix broken video frame rate override control.
+
2015-09-30 Carl Hetherington <cth@carlh.net>
* Version 2.3.11 released.
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index 5d74773b2..e416a671c 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -248,37 +248,31 @@ TimingPanel::film_content_changed (int property)
update_play_length ();
}
- if (property == VideoContentProperty::VIDEO_FRAME_RATE) {
- set<double> check;
+ if (property == VideoContentProperty::VIDEO_FRAME_RATE || property == SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE) {
+ set<double> check_vc;
shared_ptr<const VideoContent> vc;
+ int count_sc = 0;
+ shared_ptr<const SubtitleContent> sc;
BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
- shared_ptr<const VideoContent> t = dynamic_pointer_cast<const VideoContent> (i);
- if (t) {
- check.insert (t->video_frame_rate ());
- vc = t;
+ shared_ptr<const VideoContent> vt = dynamic_pointer_cast<const VideoContent> (i);
+ if (vt) {
+ check_vc.insert (vt->video_frame_rate ());
+ vc = vt;
}
+ shared_ptr<const SubtitleContent> st = dynamic_pointer_cast<const SubtitleContent> (i);
+ if (st) {
+ ++count_sc;
+ sc = st;
+ }
+
}
- if (check.size() == 1) {
- checked_set (_video_frame_rate, raw_convert<string> (vc->video_frame_rate (), 5));
- _video_frame_rate->Enable (true);
- } else {
- checked_set (_video_frame_rate, wxT (""));
- _video_frame_rate->Enable (false);
- }
- }
- if (property == SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE) {
- shared_ptr<const SubtitleContent> check;
- int count = 0;
- BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
- shared_ptr<const SubtitleContent> t = dynamic_pointer_cast<const SubtitleContent> (i);
- if (t) {
- check = t;
- ++count;
+ if (check_vc.size() == 1 || count_sc == 1) {
+ if (vc) {
+ checked_set (_video_frame_rate, raw_convert<string> (vc->video_frame_rate (), 5));
+ } else if (sc) {
+ checked_set (_video_frame_rate, raw_convert<string> (sc->subtitle_video_frame_rate (), 5));
}
- }
- if (count == 1) {
- checked_set (_video_frame_rate, raw_convert<string> (check->subtitle_video_frame_rate (), 5));
_video_frame_rate->Enable (true);
} else {
checked_set (_video_frame_rate, wxT (""));