Tiny cleanup.
authorCarl Hetherington <cth@carlh.net>
Sat, 15 Dec 2012 23:16:13 +0000 (23:16 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 15 Dec 2012 23:16:13 +0000 (23:16 +0000)
src/wx/ffmpeg_player.cc

index 6f3a4cf4c39a667f4d686aac5b9eed97c3c398eb..a8e580617087c3211f5e63183b9a9d3a0946e173 100644 (file)
@@ -103,8 +103,8 @@ FFmpegPlayer::timer (wxTimerEvent& ev)
        decode_frame ();
        convert_frame ();
 
-       double const video_length_in_seconds = static_cast<double>(_format_context->duration) / AV_TIME_BASE;
        if (_last_frame_in_seconds) {
+               double const video_length_in_seconds = static_cast<double>(_format_context->duration) / AV_TIME_BASE;
                int const new_slider_position = 4096 * _last_frame_in_seconds / video_length_in_seconds;
                if (new_slider_position != _slider->GetValue()) {
                        _slider->SetValue (new_slider_position);