Remove GL context accessor and hence lock.
authorCarl Hetherington <cth@carlh.net>
Tue, 19 Nov 2019 22:06:50 +0000 (23:06 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 8 Jan 2020 20:56:47 +0000 (21:56 +0100)
src/wx/gl_video_view.cc
src/wx/gl_video_view.h

index 3cf58757d08bc441c662fb283db28516d9806ae2..df45a143f42206fde7d1633aa656703bf2a56052 100644 (file)
@@ -282,11 +282,8 @@ GLVideoView::thread ()
 try
 {
        /* XXX_b: check all calls and signal emissions in this method & protect them if necessary */
 try
 {
        /* XXX_b: check all calls and signal emissions in this method & protect them if necessary */
-       {
-               boost::mutex::scoped_lock lm (_context_mutex);
-               _context = new wxGLContext (_canvas);
-               _canvas->SetCurrent (*_context);
-       }
+       _context = new wxGLContext (_canvas);
+       _canvas->SetCurrent (*_context);
 
        std::cout << "Here we go " << video_frame_rate() << " " << to_string(length()) << "\n";
 
 
        std::cout << "Here we go " << video_frame_rate() << " " << to_string(length()) << "\n";
 
@@ -314,10 +311,7 @@ try
                dcpomatic_sleep_milliseconds (time_until_next_frame());
        }
 
                dcpomatic_sleep_milliseconds (time_until_next_frame());
        }
 
-       {
-               boost::mutex::scoped_lock lm (_context_mutex);
-               delete _context;
-       }
+       delete _context;
 }
 catch (boost::thread_interrupted& e)
 {
 }
 catch (boost::thread_interrupted& e)
 {
@@ -326,13 +320,6 @@ catch (boost::thread_interrupted& e)
        return;
 }
 
        return;
 }
 
-wxGLContext *
-GLVideoView::context () const
-{
-       boost::mutex::scoped_lock lm (_context_mutex);
-       return _context;
-}
-
 bool
 GLVideoView::display_next_frame (bool non_blocking)
 {
 bool
 GLVideoView::display_next_frame (bool non_blocking)
 {
index 73db3535d2775c7fdc84b46482e7a1143948a4fd..44a4057fd1f55cd816fe0b377b91d3b22de024e9 100644 (file)
@@ -52,12 +52,9 @@ private:
        void paint ();
        void draw ();
        void thread ();
        void paint ();
        void draw ();
        void thread ();
-       wxGLContext* context () const;
 
        wxGLCanvas* _canvas;
 
        wxGLCanvas* _canvas;
-
        wxGLContext* _context;
        wxGLContext* _context;
-       mutable boost::mutex _context_mutex;
 
        GLuint _id;
        boost::optional<dcp::Size> _size;
 
        GLuint _id;
        boost::optional<dcp::Size> _size;