Merge master.
[dcpomatic.git] / src / wx / film_viewer.cc
index a2c4898382eb67e0c84f7047afa5489fa69c0d12..7e1b618119eec5367b0374fa09239886a3f12181 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -176,8 +176,8 @@ FilmViewer::timer ()
 
        DCPTime const len = _film->length ();
 
-       if (len) {
-               int const new_slider_position = 4096 * _player->video_position() / len;
+       if (len.get ()) {
+               int const new_slider_position = 4096 * _player->video_position().get() / len.get();
                if (new_slider_position != _slider->GetValue()) {
                        _slider->SetValue (new_slider_position);
                }
@@ -399,7 +399,7 @@ FilmViewer::back_clicked ()
        */
 
        DCPTime p = _player->video_position() - DCPTime::from_frames (2, _film->video_frame_rate ());
-       if (p < 0) {
+       if (p < DCPTime ()) {
                p = DCPTime ();
        }
        
@@ -429,7 +429,7 @@ FilmViewer::player_changed (bool frequent)
        if (frequent) {
                return;
        }
-       
+
        calculate_sizes ();
        fetch_current_frame_again ();
 }