Use atomic for _dcp_decode_reduction.
[dcpomatic.git] / src / lib / player.h
index 511a579a08baed0f8f0be5a5f46c9a6f78003d54..ce8b7cc5a53894fcc6d727d5ae790f393c0417f9 100644 (file)
@@ -83,7 +83,6 @@ public:
        std::vector<std::shared_ptr<dcpomatic::Font>> get_subtitle_fonts ();
        std::list<ReferencedReelAsset> get_reel_assets ();
        dcp::Size video_container_size () const {
-               boost::mutex::scoped_lock lm (_mutex);
                return _video_container_size;
        }
 
@@ -174,7 +173,7 @@ private:
        /** Size of the image we are rendering to; this may be the DCP frame size, or
         *  the size of preview in a window.
         */
-       dcp::Size _video_container_size;
+       boost::atomic<dcp::Size> _video_container_size;
        std::shared_ptr<Image> _black_image;
 
        /** true if the player should ignore all video; i.e. never produce any */
@@ -197,7 +196,7 @@ private:
        /** Time of the next audio that we will emit, or the time of the last accurate seek */
        boost::optional<dcpomatic::DCPTime> _next_audio_time;
 
-       boost::optional<int> _dcp_decode_reduction;
+       boost::atomic<boost::optional<int>> _dcp_decode_reduction;
 
        typedef std::map<std::weak_ptr<Piece>, std::shared_ptr<PlayerVideo>, std::owner_less<std::weak_ptr<Piece>>> LastVideoMap;
        LastVideoMap _last_video;