+shared_ptr<Image>
+PlayerVideo::image (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
+{
+ /* XXX: this assumes that image() and prepare() are only ever called with the same parameters (except crop, inter size, out size, fade) */
+
+ boost::mutex::scoped_lock lm (_mutex);
+ if (!_image || _crop != _image_crop || _inter_size != _image_inter_size || _out_size != _image_out_size || _fade != _image_fade) {
+ make_image (pixel_format, aligned, fast);
+ }
+ return _image;
+}
+
+/** Create an image for this frame. A lock must be held on _mutex.