diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-11-19 23:57:14 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-01-08 21:56:47 +0100 |
| commit | 798819f74c6d194b95d3458f88b7ad60ef5f282c (patch) | |
| tree | fa255d42af45799b7456407f6913394bf0889fbe /src/wx/video_view.h | |
| parent | edfb627f1226814ac804473b54d781ffd6db2700 (diff) | |
Nicer protection of _player_video. Always run GL thread rather than starting/stopping it.
Diffstat (limited to 'src/wx/video_view.h')
| -rw-r--r-- | src/wx/video_view.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/wx/video_view.h b/src/wx/video_view.h index 06067130c..8d763204c 100644 --- a/src/wx/video_view.h +++ b/src/wx/video_view.h @@ -84,20 +84,23 @@ protected: bool get_next_frame (bool non_blocking); int time_until_next_frame () const; dcpomatic::DCPTime one_video_frame () const; + int video_frame_rate () const { boost::mutex::scoped_lock lm (_mutex); return _video_frame_rate; } + dcpomatic::DCPTime length () const { boost::mutex::scoped_lock lm (_mutex); return _length; } - FilmViewer* _viewer; - std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> _player_video; + std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> player_video () const { + boost::mutex::scoped_lock lm (_mutex); + return _player_video; + } - /** Mutex protecting all the state in VideoView */ - mutable boost::mutex _mutex; + FilmViewer* _viewer; #ifdef DCPOMATIC_VARIANT_SWAROOP bool _in_watermark; @@ -106,6 +109,10 @@ protected: #endif private: + /** Mutex protecting all the state in VideoView */ + mutable boost::mutex _mutex; + + std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> _player_video; int _video_frame_rate; dcpomatic::DCPTime _length; }; |
