Barely-functioning GL playback with new arrangement.
[dcpomatic.git] / src / lib / j2k_image_proxy.cc
index 1422b6948426c9db21858a16d5dec27ae6d3b50e..31fda2510492d9285f8987c73a41acd9551a5435 100644 (file)
@@ -137,7 +137,6 @@ J2KImageProxy::prepare (optional<dcp::Size> target_size) const
        }
 
        shared_ptr<dcp::OpenJPEGImage> decompressed = dcp::decompress_j2k (const_cast<uint8_t*> (_data.data().get()), _data.size (), reduce);
-
        _image.reset (new Image (_pixel_format, decompressed->size(), true));
 
        int const shift = 16 - decompressed->precision (0);
@@ -169,9 +168,13 @@ J2KImageProxy::prepare (optional<dcp::Size> target_size) const
 }
 
 pair<shared_ptr<Image>, int>
-J2KImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size> target_size) const
+J2KImageProxy::image (optional<dcp::Size> target_size) const
 {
-       return make_pair (_image, prepare(target_size));
+       int const r = prepare (target_size);
+       /* I think this is safe without a lock on mutex.  _image is guaranteed to be
+          set up when prepare() has happened.
+       */
+       return make_pair (_image, r);
 }
 
 void