Try to fix range UI a little.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Oct 2012 01:09:11 +0000 (02:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Oct 2012 01:09:11 +0000 (02:09 +0100)
ChangeLog
src/lib/film.cc
src/lib/film.h
src/wx/film_editor.cc

index fa2e67db173abb2db86afbb817a73fe590979581..47273963a2e74e593cb22ed60eca8e325bea6ec9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
        * Basic support for selection of audio
        and subtitle streams.
 
+       * Fixes for audio/video sync in some cases.
+
 2012-10-09  Carl Hetherington  <cth@carlh.net>
 
        * Version 0.55 released.
index e8a23377d42d54c66621b799e8b30add56aacd07..b92d8d2fa2b904af4d1bb59c82ab530eab004b71 100644 (file)
@@ -1075,6 +1075,16 @@ Film::set_dcp_frames (int f)
        signal_changed (DCP_FRAMES);
 }
 
+void
+Film::unset_dcp_frames ()
+{
+       {
+               boost::mutex::scoped_lock lm (_state_mutex);
+               _dcp_frames = boost::none;
+       }
+       signal_changed (DCP_FRAMES);
+}
+
 void
 Film::set_dcp_trim_action (TrimAction a)
 {
index 13189170684cb09fe11181dd3e0ba8150e63357c..3eff9e3dae37cbc26e084b62d18e5494ba6ae75f 100644 (file)
@@ -349,6 +349,7 @@ public:
        void set_filters (std::vector<Filter const *>);
        void set_scaler (Scaler const *);
        void set_dcp_frames (int);
+       void unset_dcp_frames ();
        void set_dcp_trim_action (TrimAction);
        void set_dcp_ab (bool);
        void set_audio_stream (int);
index 91db579c5252d90d768c851005cdde669e3b3416..3e5079cc55a37a6997225bc777007a29e24e7956 100644 (file)
@@ -776,7 +776,12 @@ FilmEditor::change_dcp_range_clicked (wxCommandEvent &)
 void
 FilmEditor::dcp_range_changed (int frames, TrimAction action)
 {
-       _film->set_dcp_frames (frames);
+       if (frames == 0) {
+               _film->unset_dcp_frames ();
+       } else {
+               _film->set_dcp_frames (frames);
+       }
+       
        _film->set_dcp_trim_action (action);
 }