summaryrefslogtreecommitdiff
path: root/src/wx/gl_video_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-11-19 17:07:35 +0100
committerCarl Hetherington <cth@carlh.net>2020-01-08 21:56:47 +0100
commit86a866d5f3f5bf2fec67d1c813524479c6727eab (patch)
treed6399fb66872751ed10a0c2db0e143dea32c627e /src/wx/gl_video_view.cc
parent046d84f45621f7e128cb30160a315f98881c6f4b (diff)
Clean up access to stuff from Film.
Diffstat (limited to 'src/wx/gl_video_view.cc')
-rw-r--r--src/wx/gl_video_view.cc40
1 files changed, 4 insertions, 36 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index c3a611283..3cf58757d 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -55,7 +55,6 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
: VideoView (viewer)
, _vsync_enabled (false)
, _thread (0)
- , _one_shot (false)
{
_canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
_canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this));
@@ -278,20 +277,6 @@ GLVideoView::stop ()
_thread = 0;
}
-bool
-GLVideoView::one_shot () const
-{
- boost::mutex::scoped_lock lm (_one_shot_mutex);
- return _one_shot;
-}
-
-void
-GLVideoView::set_one_shot (bool s)
-{
- boost::mutex::scoped_lock lm (_one_shot_mutex);
- _one_shot = s;
-}
-
void
GLVideoView::thread ()
try
@@ -303,20 +288,12 @@ try
_canvas->SetCurrent (*_context);
}
- while (true) {
- if (!film() && !one_shot()) {
- /* XXX: this should be an indefinite wait until
- one of our conditions becomes true.
- */
- dcpomatic_sleep_milliseconds (40);
- continue;
- }
-
- set_one_shot (false);
+ std::cout << "Here we go " << video_frame_rate() << " " << to_string(length()) << "\n";
+ while (true) {
dcpomatic::DCPTime const next = position() + one_video_frame();
- if (next >= film()->length()) {
+ if (next >= length()) {
_viewer->stop ();
_viewer->emit_finished ();
continue;
@@ -359,15 +336,6 @@ GLVideoView::context () const
bool
GLVideoView::display_next_frame (bool non_blocking)
{
- bool const g = get_next_frame (non_blocking);
- set_one_shot (true);
- return g;
+ return get_next_frame (non_blocking);
}
-dcpomatic::DCPTime
-GLVideoView::one_video_frame () const
-{
- return dcpomatic::DCPTime::from_frames (1, film()->video_frame_rate());
-}
-
-