More OS X packaging tweaks.
[dcpomatic.git] / src / wx / film_viewer.cc
index 4f2985a061db3677ebfb6d0ed5c89bf2fd25c9f8..6845031cf96cf2688775bef192da3548093de5bb 100644 (file)
@@ -59,7 +59,10 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
        , _display_frame_x (0)
        , _got_frame (false)
 {
+#ifndef __WXOSX__
        _panel->SetDoubleBuffered (true);
+#endif
+       
 #if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9
        _panel->SetBackgroundStyle (wxBG_STYLE_PAINT);
 #endif 
@@ -129,9 +132,9 @@ FilmViewer::film_changed (Film::Property p)
                if (_decoders.video == 0) {
                        break;
                }
+               _decoders.video->set_subtitle_stream (_film->subtitle_stream());
                _decoders.video->Video.connect (bind (&FilmViewer::process_video, this, _1, _2, _3, _4));
                _decoders.video->OutputChanged.connect (boost::bind (&FilmViewer::decoder_changed, this));
-               _decoders.video->set_subtitle_stream (_film->subtitle_stream());
                calculate_sizes ();
                get_frame ();
                _panel->Refresh ();
@@ -204,9 +207,6 @@ FilmViewer::timer (wxTimerEvent &)
                return;
        }
        
-       _panel->Refresh ();
-       _panel->Update ();
-
        get_frame ();
 
        if (_film->length()) {
@@ -215,6 +215,9 @@ FilmViewer::timer (wxTimerEvent &)
                        _slider->SetValue (new_slider_position);
                }
        }
+
+       _panel->Refresh ();
+       _panel->Update ();
 }
 
 
@@ -326,7 +329,7 @@ FilmViewer::raw_to_display ()
 
                Size const cropped_size = _film->cropped_size (_film->size ());
 
-               Rect tx = subtitle_transformed_area (
+               dvdomatic::Rect tx = subtitle_transformed_area (
                        float (_film_size.width) / cropped_size.width,
                        float (_film_size.height) / cropped_size.height,
                        _raw_sub->area(), _film->subtitle_offset(), _film->subtitle_scale()
@@ -410,7 +413,8 @@ FilmViewer::process_video (shared_ptr<const Image> image, bool, shared_ptr<Subti
        _got_frame = true;
 
        double const fps = _decoders.video->frames_per_second ();
-       _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps))));
+       /* Count frame number from 1 ... not sure if this is the best idea */
+       _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps)) + 1));
 
        double w = t;
        int const h = (w / 3600);
@@ -433,7 +437,7 @@ FilmViewer::get_frame ()
                _display_frame.reset ();
                return;
        }
-       
+
        try {
                _got_frame = false;
                while (!_got_frame) {